Skip to:
Content

BuddyPress.org

Changeset 11162


Ignore:
Timestamp:
09/28/2016 01:23:31 AM (5 years ago)
Author:
dcavins
Message:

BP Groups Admin Types: Correct variable usage.

Reorganize the logic in
BP_Groups_List_Table::column_content_group_type()
to ensure that the output variable exists before we
attempt to apply filters to it.

Props mercime.

See #7175.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-groups/classes/class-bp-groups-list-table.php

    r11141 r11162  
    711711     * @param array  $item        The current group item in the loop.
    712712     */
    713     public function column_content_group_type( $retval, $column_name, $item ) {
     713    public function column_content_group_type( $retval = '', $column_name, $item ) {
    714714        if ( 'bp_group_type' !== $column_name ) {
    715715            return $retval;
     
    722722        if ( $type_obj = bp_groups_get_group_type_object( $type ) ) {
    723723            $url         = add_query_arg( array( 'bp-group-type' => urlencode( $type ) ) );
    724             $type_string = '<a href="' . esc_url( $url ) . '">' . esc_html( $type_obj->labels['singular_name'] ) . '</a>';
     724            $retval = '<a href="' . esc_url( $url ) . '">' . esc_html( $type_obj->labels['singular_name'] ) . '</a>';
    725725        }
    726726
     
    730730         * @since 2.7.0
    731731         *
    732          * @param string $type_string Markup for the Group Type column.
    733          * @parma array  $item        The current group item in the loop.
    734          */
    735         echo apply_filters_ref_array( 'bp_groups_admin_get_group_type_column', array( $type_string, $item ) );
     732         * @param string $retval Markup for the Group Type column.
     733         * @parma array  $item   The current group item in the loop.
     734         */
     735        echo apply_filters_ref_array( 'bp_groups_admin_get_group_type_column', array( $retval, $item ) );
    736736    }
    737737
Note: See TracChangeset for help on using the changeset viewer.