Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/27/2016 03:07:47 AM (9 years ago)
Author:
imath
Message:

Groups: Make sure BP_Group_Extension::widget_display() can be used

On the single item home (eg: a custom front template), it will now be possible to use bp_custom_group_boxes() to get the content provided by the Group extensions in their widget.

2 unit tests are checking this only happens when on the Groups single item home.

Fixes #7131

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/assets/group-extensions.php

    r9819 r10905  
    410410    }
    411411}
     412
     413class BPTest_Group_Extension_Widget_Method extends BP_Group_Extension {
     414    public function __construct() {
     415        $class_name = get_class( $this );
     416
     417        $args = array(
     418            'name' => $class_name,
     419            'slug' => sanitize_title( $class_name ),
     420        );
     421
     422        parent::init( $args );
     423    }
     424
     425    public function widget_display() {
     426        echo 'Widget Displayed';
     427    }
     428}
Note: See TracChangeset for help on using the changeset viewer.