[buddypress-trac] [BuddyPress Trac] #9063: New pages slug do not support WordPress subpages
buddypress-trac
noreply at wordpress.org
Mon Aug 5 10:46:19 UTC 2024
#9063: New pages slug do not support WordPress subpages
-------------------------------------------------+-----------------------
Reporter: slaFFik | Owner: imath
Type: defect (bug) | Status: assigned
Priority: normal | Milestone: 15.0.0
Component: Core | Version: 12.0.0
Severity: normal | Resolution:
Keywords: needs-docs dev-feedback 2nd-opinion |
-------------------------------------------------+-----------------------
Changes (by imath):
* keywords: needs-patch => needs-docs dev-feedback 2nd-opinion
Comment:
Hi @slaFFik
I believe you can already get what you need using the current state of the
Rewrites API.
You simply need to use these kind of filters:
{{{
function prepend_community_slug( $root_slug ) {
return 'community/' . $root_slug;
}
add_filter( 'bp_activity_root_slug', 'prepend_community_slug' );
add_filter( 'bp_members_root_slug', 'prepend_community_slug' );
add_filter( 'bp_groups_root_slug', 'prepend_community_slug' );
}}}
Refresh your permalinks.
Create a WordPress page like "Community", making sure it has the
`community` slug, then use a WP Nav Menu or a Site Editor Navigation to
build your "Community Submenu" with BuddyPress directories.
I'm not sure we need to do anything particular to the URLs settings tab UI
like adding an option to store the slug to prepend to the Component's root
one.
A new documentation page into this area
https://github.com/buddypress/buddypress/tree/master/docs/user/advanced
explaining the above steps should be enough imho.
What do you think @slaFFik @dcavins @emaralive & @vapvarun ?
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/9063#comment:12>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac
More information about the buddypress-trac
mailing list