Skip to:
Content

BuddyPress.org

Changeset 10007


Ignore:
Timestamp:
07/10/2015 10:17:49 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Admin: Add primary columns to our list table implementations.

The commit ensures BuddyPress's list-tables have "primary" columns, to play nicely with new WordPress 4.3.0 requirement introduced in [WP32722]. BuddyPress manually sets $_column_headers for horse reasons.

See #6465. For 2.3.3 (2.3 branch)

Location:
branches/2.3/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.3/src/bp-activity/bp-activity-admin.php

    r10006 r10007  
    11981198            array(),
    11991199            $this->get_sortable_columns(),
     1200            $this->get_default_primary_column_name(),
    12001201        );
    12011202
     
    17311732        return $tree;
    17321733    }
     1734
     1735    /**
     1736     * Get name of default primary column
     1737     *
     1738     * @since BuddyPress (2.3.3)
     1739     * @access protected
     1740     *
     1741     * @return string
     1742     */
     1743    protected function get_default_primary_column_name() {
     1744        return 'author';
     1745    }
    17331746}
  • branches/2.3/src/bp-groups/bp-groups-admin.php

    r10006 r10007  
    12941294            array(),
    12951295            $this->get_sortable_columns(),
     1296            $this->get_default_primary_column_name(),
    12961297        );
    12971298
     
    17051706        return apply_filters( 'bp_groups_admin_get_group_custom_column', '', $column_name, $item );
    17061707    }
     1708
     1709    /**
     1710     * Get name of default primary column
     1711     *
     1712     * @since BuddyPress (2.3.3)
     1713     * @access protected
     1714     *
     1715     * @return string
     1716     */
     1717    protected function get_default_primary_column_name() {
     1718        // comment column is mapped to Group's name
     1719        return 'comment';
     1720    }
    17071721}
  • branches/2.3/src/bp-members/admin/bp-members-admin-classes.php

    r9877 r10007  
    207207        $style = '';
    208208        foreach ( $this->items as $userid => $signup_object ) {
     209
     210            // Avoid a notice error appearing since 4.3.0
     211            if ( isset( $signup_object->id ) ) {
     212                $signup_object->ID = $signup_object->id;
     213            }
     214
    209215            $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
    210216            echo "\n\t" . $this->single_row( $signup_object, $style );
     
    570576        $style = '';
    571577        foreach ( $this->items as $userid => $signup_object ) {
     578
     579            // Avoid a notice error appearing since 4.3.0
     580            if ( isset( $signup_object->id ) ) {
     581                $signup_object->ID = $signup_object->id;
     582            }
     583
    572584            $style = ( ' class="alternate"' == $style ) ? '' : ' class="alternate"';
    573585            echo "\n\t" . $this->single_row( $signup_object, $style );
Note: See TracChangeset for help on using the changeset viewer.