Skip to:
Content
Pages
Categories
Search
Top
Bottom

How to get the page ID associated with a component


  • Garrett Hyder
    Participant

    @garrett-eclipse

    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#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.

    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.
Skip to toolbar