Ticket #29030: 29030.diff
File 29030.diff, 2.7 KB (added by , 5 years ago) |
---|
-
src/js/_enqueues/admin/common.js
110 110 * @returns {string} The hidden column names separated by a comma. 111 111 */ 112 112 hidden : function() { 113 return $( '.manage-column[id]' ).filter( ':hidden' ).map(function() { 114 return this.id; 113 //Checking for unchecked column names is better and more robust than checking for hidden column headers 114 return $( '.hide-column-tog' ).filter(':not(:checked)' ).map(function() { 115 return this.value; 115 116 }).get().join( ',' ); 116 117 }, 117 118 -
src/wp-admin/includes/ajax-actions.php
1573 1573 wp_die( -1 ); 1574 1574 } 1575 1575 1576 $special = get_special_columns(); //get list of special columns that are not meant to be hidden 1576 1577 $hidden = ! empty( $_POST['hidden'] ) ? explode( ',', $_POST['hidden'] ) : array(); 1578 $hidden = array_diff($hidden, $special); //remove the special columns from the list of columns to be hidden 1577 1579 update_user_option( $user->ID, "manage{$page}columnshidden", $hidden, true ); 1578 1580 1579 1581 wp_die( 1 ); -
src/wp-admin/includes/class-wp-screen.php
1071 1071 <fieldset class="metabox-prefs"> 1072 1072 <legend><?php echo $legend; ?></legend> 1073 1073 <?php 1074 $special = array( '_title', 'cb', 'comment', 'media', 'name', 'title', 'username', 'blogname' );1074 $special = get_special_columns(); //get list of special columns that are not meant to be hidden 1075 1075 1076 1076 foreach ( $columns as $column => $title ) { 1077 1077 // Can't hide these for they are special -
src/wp-admin/includes/screen.php
240 240 function set_current_screen( $hook_name = '' ) { 241 241 WP_Screen::get( $hook_name )->set_current_screen(); 242 242 } 243 244 /** 245 * Get a list of special columns. 246 * 247 * @since X.Y.Z 248 * 249 * @return array 250 */ 251 function get_special_columns() { 252 $special = array( '_title', 'cb', 'comment', 'media', 'name', 'title', 'username', 'blogname' ); 253 254 /** 255 * Filters the list of special columns. 256 * 257 * @since X.Y.Z 258 * 259 * @param array $special An array of special columns. 260 */ 261 return apply_filters( 'special_columns', $special ); 262 }