How to get the page ID associated with a component
-
Hello,
I found I needed to get the permalink and title for a component so needed to determine the page ID associated with a component.
Currently there’s no method so I’ve opened a trac ticket;
https://buddypress.trac.wordpress.org/ticket/7025#ticketAnd you can see how to do this below;
$component = bp_current_component(); $bp_pages = get_option( 'bp-pages' ); $page_id = $bp_pages[$component];
*We simply take the component slug and use it to look up the page ID from the bp-pages option.
Cheers
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.