Opened 10 months ago
Last modified 5 months ago
#9128 assigned defect (bug)
Subnavs slug prefixing
Reported by: | raviousprime | Owned by: | imath |
---|---|---|---|
Milestone: | Awaiting Review | Priority: | low |
Severity: | normal | Version: | 12.0.0 |
Component: | Core | Keywords: | |
Cc: |
Description
Hello,
I am facing an issue while trying to add BuddyPress 12 compatibility to my plugin.
Earlier, we used the following URL structure(with screen callbacks) and they worked
- http://example.com/members/user-name/component-name/some-slug/
- http://example.com/members/user-name/component-name/type/some-slug
Both of these worked earlier('type' is a fixed string).
I am unable to get the 2nd URL working with BP 12.0+. Is it a bug in the new rewrite API? or am I missing something?
Here is what I have done
<?php $user_domain = bp_is_user() ? bp_displayed_user_domain() : bp_loggedin_user_domain(); $parent_url = trailingslashit( $user_domain . $this->slug ); $sub_nav[] = array( 'name' => 'My Gallery', 'slug' => 'my-galleries', 'parent_url' => $parent_url, 'parent_slug' => $this->slug, 'screen_function' => array( $this, 'render_my_gallery' ), 'position' => 10, 'item_css_id' => 'gallery-my-gallery', ); $supported_types = array( 'photo' => 'Photo', 'video' => 'Video', ); $i = 0; foreach ( $supported_types as $type => $label ) { $sub_nav[] = array( 'name' => $label, 'slug' => 'type/' . $type, 'parent_url' => $parent_url, 'parent_slug' => $this->slug, 'screen_function' => array( $this, 'render_gallery_by_type' ), 'position' => 20 + $i, ); $i = $i + 10; // increment the position. }
Thank you for your assistance.
Change History (4)
Note: See
TracTickets for help on using
tickets.
@imath can you tell if that's possibly a bug?