[buddypress-trac] [BuddyPress Trac] #6434: BuddyPress $bp->groups->slug Bug?

buddypress-trac noreply at wordpress.org
Thu May 14 10:10:25 UTC 2015


#6434: BuddyPress $bp->groups->slug Bug?
--------------------------------+----------------------
 Reporter:  dunhakdis           |       Owner:
     Type:  defect (bug)        |      Status:  closed
 Priority:  high                |   Milestone:
Component:  Component - Groups  |     Version:  2.2.3
 Severity:  major               |  Resolution:  invalid
 Keywords:                      |
--------------------------------+----------------------
Changes (by boonebgorges):

 * status:  new => closed
 * resolution:   => invalid
 * milestone:  Awaiting Review =>


Comment:

 Hi dunhakdis - Thanks for the report.

 The Groups component (and most BP components) have two different concepts
 of "slug". One is the "root slug". This is what is determined by the slug
 of the Groups directory page (Dashboard > Pages), and it's the slug used
 when building URLs where the component slug directly follows the site URL.
 So, on a site `example.com`, `buddypress()->groups->root_slug` is used to
 build URLs like the following:

 - `example.com/groups/`
 - `example.com/groups/my-cool-group/`

 `buddypress()->groups->slug` is the other kind of slug (the non-"root"
 slug). This is used primarily to build URLs where the slug appears later
 in the URL. Eg: `example.com/members/boone/groups/`. By default, this slug
 is not affected by the post_name of the Groups directory page.

 It sounds like, in your case, you should be using the `root_slug`. (Or
 better yet - if you're linking into a specific group, use
 `bp_get_group_permalink( $group_object )` to get a full group URL.)

 I'm going to close this ticket as invalid, but if I've misunderstood your
 intent, please feel free to follow up.

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/6434#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list