Skip to:
Content
Pages
Categories
Search
Top
Bottom

How can I get the parent component of a page?

  • @jreeve

    Participant

    I can get the current component with bp_current_component(), which for URLS like /members/[username]/groups returns “groups,” and I can check whether “groups” is a root component with bp_is_root_component(), but I can’t seem to find a function to get the parent component, which in this case would be “xprofile.” The function bp_is_profile_component() would seem to do that, since the doc says “Check whether the current page is part of the Profile component,” but since it uses bp_is_current_component() (which returns “groups” in this case), it doesn’t work as expected. How can I do something like bp_parent_component(), or at least bp_root_component()?

Viewing 4 replies - 1 through 4 (of 4 total)
  • @danbp

    Participant

    Hi @jreeve

    you’ll find these informations, and many others, in /bp-core/bp-core-template.php
    Line 790 and below.

    @jreeve

    Participant

    @danbp: in fact, bp-core-template.php is what I’ve been describing. I guess you’re saying that if there isn’t a function that does this thing? Maybe this belongs as a bug report instead of a support forum thread. I’ll open trac tickets for this.

    @jreeve

    Participant

    In case anyone else runs into this issue, I’ve created issue #5827 here: https://buddypress.trac.wordpress.org/ticket/5827#ticket

    @danbp

    Participant

    i guess it is more some understanding on my side or some weird BP jargon 😉

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How can I get the parent component of a page?’ is closed to new replies.
Skip to toolbar