Skip to:
Content

BuddyPress.org

Opened 5 years ago

Closed 5 years ago

Last modified 4 years ago

#6725 closed defect (bug)

Problem with bp_is_group_activity()

Reported by: henry.wright Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Core Keywords:
Cc:

Description

There seems to be a problem with bp_is_group_activity()

For example, when viewing example.com/groups/group-name, I'd expect the following to output true. It actually outputs false.

function my_test() {
	if ( bp_is_group_activity() ) {
		echo "true";
	} else {
		echo "false";
	}
}
add_action( 'bp_before_group_activity_post_form', 'my_test' );

Change History (7)

#1 @r-a-y
5 years ago

  • Keywords reporter-feedback added

Hi henry.wright,

Are you testing on BuddyPress 2.3 or 2.4?

In 2.4.0, we've made some changes to this function due in part to the custom group homepage feature.

See the bpdevel post about this:
https://bpdevel.wordpress.com/2015/10/03/get-ready-2-4-0-will-introduce-important-changes-in-groups-homes/

Specifically the "Important changes in some Group’s conditional tags" section.

#2 @henry.wright
5 years ago

Hi @r-a-y, thanks for pointing out the article! I hadn't seen it yet, so just read through it.

Regarding the problem, I think it still remains because:

  • I'm using v2.3.5
  • I'm using the group's activity as my group "home"

#3 @henry.wright
5 years ago

  • Keywords reporter-feedback removed

#4 @DJPaul
5 years ago

Can you retest on 2.4 please?

#5 @r-a-y
5 years ago

  • Milestone Awaiting Review deleted
  • Status changed from new to closed
  • Version 2.3.3 deleted

For example, when viewing example.com/groups/group-name, I'd expect the following to output true. It actually outputs false.

Regarding bp_is_group_activity() returning false in BP 2.3.x, see imath's comment about this:
https://buddypress.trac.wordpress.org/ticket/6388#comment:23

In BP 2.4.0, I can confirm that bp_is_group_activity() returns true when you land on a group's permalink (example.com/groups/group-name) without any custom front pages.

Going to mark this as a duplicate of #6388.

Last edited 5 years ago by r-a-y (previous) (diff)

#6 @henry.wright
5 years ago

Thanks @r-a-y

#7 @DJPaul
4 years ago

  • Component changed from API to Core
Note: See TracTickets for help on using tickets.