Skip to:
Content

BuddyPress.org

Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#3854 closed defect (bug) (worksforme)

bp_is_groups_component conditional does not work on 3rd Party Group Component Pages

Reported by: bowromir Owned by:
Milestone: Priority: normal
Severity: normal Version: 1.5.2
Component: Groups Keywords:
Cc:

Description

The bp_is_groups_component() conditional can be used to check if you're currently on a group page or inside the groups directory. This works fine, unless you are on a Group page added by a 3rd party plugin (for exampel BuddyPress Docs). When you visit a page the conditional is "false" while it should be true. two screenshots that illustrate this. Please check the sidebar "widget"to see what happens.

Core Group Page: http://cl.ly/3o402G2X1u2Y1Y2U0D26
3rd Party Group Page: http://cl.ly/0l3F1x3f2Y3q1m1e3n0k

Small part of the code used for the Group Sidebar

elseif ( function_exists('bp_is_page') && bp_is_groups_component() ) {
                if ( is_active_sidebar( 'groups-sidebar' ) ) {
                    dynamic_sidebar( 'groups-sidebar');
				} else { ?>
				<div class="widget"><h4>BP Group Sidebar.</h4>
				<a href="<?php echo home_url( '/'  ); ?>wp-admin/widgets.php" title="Add Widgets">Add Widgets</a></div><?php
				}

Change History (4)

#1 @boonebgorges
10 years ago

  • Keywords reporter-feedback added
  • Milestone changed from Awaiting Review to Future Release

I can't reproduce this. I put the following in my bp-custom.php:

function bbg_test_bp_is_groups_component_in_sidebar() {
	if ( bp_is_groups_component() ) {
		echo 'THIS IS THE GROUPS COMPONENT';
	}
}
add_action( 'bp_inside_before_sidebar', 'bbg_test_bp_is_groups_component_in_sidebar' );

and it shows, as expected, on all group pages, including those created by third party components like BuddyPress Docs.

I'm guessing that there is something else in your theme logic that is causing the if...elseif...etc conditional to catch somewhere improperly. Can you provide more of this code so that it's a bit easier to see what's going on?

Moving this to Future Release for the moment. If we can't get steps to reproduce, then I'll close as worksforme.

#2 @boonebgorges
9 years ago

  • Keywords reporter-feedback removed
  • Resolution set to worksforme
  • Status changed from new to closed

Still works fine for me. If you manage to pin down steps to reproduce, please reopen.

#3 @boonebgorges
9 years ago

  • Milestone Future Release deleted
Note: See TracTickets for help on using tickets.