Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 11 years ago

#4479 closed defect (bug) (fixed)

bp_is_page(BP_GROUPS_SLUG) return true in group home page

Reported by: megainfo's profile megainfo Owned by: megainfo's profile MegaInfo
Milestone: 1.7 Priority: normal
Severity: major Version: 1.6
Component: Core Keywords: reporter-feedback
Cc: megainfodz@…

Description

Hi,

Tested in : buddypress 1.6.1 + default theme

I add this code in the content of members/single/home.php

if ( bp_is_page(BP_MEMBERS_SLUG) ) : echo [BP_MEMBERS_SLUG]" endif;
if ( bp_is_member() ) : ech o"[bp_is_member]" endif;

bp_is_page(BP_MEMBERS_SLUG) return false, bp_is_member() return true.

And in groups/single/home.php

if ( bp_is_page(BP_GROUPS_SLUG) ) : echo "BP_GROUPS_SLUG" endif;
if ( bp_is_group() ) : echo "bp_is_group" endif;

bp_is_page(BP_GROUPS_SLUG) return true and bp_is_group() return true.

I think bp_is_page(BP_GROUPS_SLUG) must return false in group home page ?

Change History (4)

#1 follow-up: @boonebgorges
12 years ago

What is bp_is_page() *supposed* to do? (We don't use it anywhere in BP.)

#2 in reply to: ↑ 1 @DJPaul
12 years ago

Replying to boonebgorges:

What is bp_is_page() *supposed* to do?

pre-1.5 version of bp_is_current_component().

#3 @johnjamesjacoby
11 years ago

  • Milestone changed from Awaiting Review to 1.7

Should depend what your slugs are and what you're checking against. For what it's worth, the old constants aren't so great anymore.

bp_is_page() should be deprecated in 1.7, since it's not used anywhere in core.

#4 @johnjamesjacoby
11 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [6612]) Deprecate bp_is_page(). Fixes #4479.

Note: See TracTickets for help on using tickets.