Skip to:
Content

BuddyPress.org

Changeset 10008


Ignore:
Timestamp:
07/10/2015 10:25:38 PM (11 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.

Fixes #6465. Props imath. For 2.4.0 (trunk)

Location:
trunk/src
Files:
3 edited

Legend:

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

    r10005 r10008  
    11981198                        array(),
    11991199                        $this->get_sortable_columns(),
     1200                        $this->get_primary_column_name(),
    12001201                );
    12011202
    12021203                return $this->_column_headers;
     1204        }
     1205
     1206        /**
     1207         * Get name of default primary column
     1208         *
     1209         * @since BuddyPress (2.3.3)
     1210         * @access protected
     1211         *
     1212         * @return string
     1213         */
     1214        protected function get_default_primary_column_name() {
     1215                return 'author';
    12031216        }
    12041217
  • trunk/src/bp-groups/bp-groups-admin.php

    r10005 r10008  
    12941294                        array(),
    12951295                        $this->get_sortable_columns(),
     1296                        $this->get_default_primary_column_name(),
    12961297                );
    12971298
    12981299                return $this->_column_headers;
     1300        }
     1301
     1302        /**
     1303         * Get name of default primary column
     1304         *
     1305         * @since BuddyPress (2.3.3)
     1306         * @access protected
     1307         *
     1308         * @return string
     1309         */
     1310        protected function get_default_primary_column_name() {
     1311                // comment column is mapped to Group's name
     1312                return 'comment';
    12991313        }
    13001314
  • trunk/src/bp-members/admin/bp-members-admin-classes.php

    r9877 r10008  
    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.