Skip to:
Content
Pages
Categories
Search
Top
Bottom

Is this really the best way to check if I’m on a member profile?


  • Nahum
    Participant

    @nahummadrid

    I’ve been using this to cover my bases when checking to see if I’m on a member profile, for say a special sidebar or component I want to show only on member profile pages and sub pages….

    ` !bp_is_blog_page() && !bp_is_register_page() && !bp_is_activation_page() && !bp_is_directory() && !bp_is_group_home() &&!bp_is_group_forum() && !bp_is_group_members() && !bp_is_group_invites() && !bp_is_group_admin_page() &&!bp_is_group_create() `

    is there something shorter?

    `bp_is_user_profile()` doesn’t not cover off on edit subpages…and doesn’t cover the member activity

Viewing 1 replies (of 1 total)

  • Boone Gorges
    Keymaster

    @boonebgorges

    In BP 1.5, there is a function `bp_is_user()`, which will return true on any member page.

    If you need to support BP 1.2.x, do the following:
    `global $bp;
    if ( !empty( $bp->displayed_user->id ) ) {
    // member page stuff
    }`

Viewing 1 replies (of 1 total)
  • The topic ‘Is this really the best way to check if I’m on a member profile?’ is closed to new replies.
Skip to toolbar