List tables:
* Avoid notices in custom list tables that manually set `$_column_headers`. Any plugins using this for a specific purpose should update. * Restore a special class name in the users list table. props georgestephanis, stephdau. see #25408. git-svn-id: https://develop.svn.wordpress.org/trunk@32717 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c7a40c6847
commit
74a6899d0d
@ -850,8 +850,9 @@ class WP_List_Table {
|
|||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
protected function get_column_info() {
|
protected function get_column_info() {
|
||||||
if ( isset( $this->_column_headers ) )
|
if ( isset( $this->_column_headers ) && is_array( $this->_column_headers ) && count( $this->_column_headers ) >= 4 ) {
|
||||||
return $this->_column_headers;
|
return $this->_column_headers;
|
||||||
|
}
|
||||||
|
|
||||||
$columns = get_column_headers( $this->screen );
|
$columns = get_column_headers( $this->screen );
|
||||||
$hidden = get_hidden_columns( $this->screen );
|
$hidden = get_hidden_columns( $this->screen );
|
||||||
|
@ -411,6 +411,9 @@ class WP_Users_List_Table extends WP_List_Table {
|
|||||||
if ( $primary === $column_name ) {
|
if ( $primary === $column_name ) {
|
||||||
$classes .= ' has-row-actions column-primary';
|
$classes .= ' has-row-actions column-primary';
|
||||||
}
|
}
|
||||||
|
if ( 'posts' === $column_name ) {
|
||||||
|
$classes .= ' num'; // Special case for that column
|
||||||
|
}
|
||||||
|
|
||||||
$style = '';
|
$style = '';
|
||||||
if ( in_array( $column_name, $hidden ) ) {
|
if ( in_array( $column_name, $hidden ) ) {
|
||||||
@ -437,7 +440,6 @@ class WP_Users_List_Table extends WP_List_Table {
|
|||||||
$r .= $role_name;
|
$r .= $role_name;
|
||||||
break;
|
break;
|
||||||
case 'posts':
|
case 'posts':
|
||||||
$attributes = 'class="posts column-posts num"' . $style;
|
|
||||||
if ( $numposts > 0 ) {
|
if ( $numposts > 0 ) {
|
||||||
$r .= "<a href='edit.php?author=$user_object->ID' class='edit'>";
|
$r .= "<a href='edit.php?author=$user_object->ID' class='edit'>";
|
||||||
$r .= '<span aria-hidden="true">' . $numposts . '</span>';
|
$r .= '<span aria-hidden="true">' . $numposts . '</span>';
|
||||||
|
Loading…
Reference in New Issue
Block a user