WordPress.org

Ready to get started?Download WordPress

Forums

Bowe Codes
[resolved] bc_group slug: incorrect link when WordPress is not in domain root folder (4 posts)

  1. kraigg
    Member
    Posted 2 years ago #

    I'm liking this plugin, it's the first one of its kind for BuddyPress. Thanks!

    But I've found a bug with displaying a specific group (bc_group slug).
    If my WordPress installation is not in my domain's root folder, the links to the group(s) are incorrect. The link strips out the directories and looks for the group in the root folder.

    For example:

    Shortcode used to display group "My Group":
    [bc_group slug="my-group"]

    My website:
    http://www.mywebsite.com/directory/wordpress

    Link for "My Group" goes to http://www.mywebsite.com/groups/my-group (incorrect) instead of http://www.mywebsite.com/directory/wordpress/groups/my-group (correct)

    http://wordpress.org/extend/plugins/bowe-codes/

  2. imath
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Kraigg,

    I'll need your help to fix this, can you try to edit the main plugin file (bowe-codes.php) at line 71 you'll find this :
    $group_home = $bp->root_domain.'/'.BP_GROUPS_SLUG.'/'.$slug.'/';
    replace it by this 2 lines :

    $group = groups_get_group( 'group_id='.$id );
    $group_home = bp_get_group_permalink( $group );

    Then tell me if it's fixing the trouble.. if so i'll upgrade the plugin. Thanks

  3. kraigg
    Member
    Posted 2 years ago #

    Thanks for that, Imath

    On line 71, I changed it to:

    $current_group_folder = site_url();
    $group_home = $current_group_folder.'/'.BP_GROUPS_SLUG.'/'.$slug.'/';

    My solution worked fine, except it conflicted with the BP Group Hierarchy plugin when it came to sub-groups. Your solution worked a lot better.

    Thanks again!

  4. imath
    Member
    Plugin Author

    Posted 2 years ago #

    Hi Kraigg,

    Thanks for your feedback.
    Then i'll add the fix to the plugin and release soon an upgrade :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.