How to get the page ID associated with a component
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;
And 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.
- You must be logged in to reply to this topic.