Ticket #15338: 15338.diff
| File 15338.diff, 11.3 KB (added by scribu, 3 years ago) |
|---|
-
wp-admin/includes/class-wp-posts-list-table.php
256 256 } 257 257 258 258 function get_columns() { 259 $screen = $this->screen;259 $screen = get_current_screen(); 260 260 261 261 if ( empty( $screen ) ) 262 262 $post_type = 'post'; … … 681 681 function inline_edit() { 682 682 global $mode; 683 683 684 $screen = $this->screen;684 $screen = get_current_screen(); 685 685 686 686 $post = get_default_post_to_edit( $screen->post_type ); 687 687 $post_type_object = get_post_type_object( $screen->post_type ); -
wp-admin/includes/class-wp-terms-list-table.php
290 290 } 291 291 292 292 function column_default( $tag, $column_name ) { 293 return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $tag->term_id );293 return apply_filters( 'manage_' . get_current_screen()->taxonomy '_custom_column', '', $column_name, $tag->term_id ); 294 294 } 295 295 296 296 /** -
wp-admin/includes/class-wp-list-table.php
78 78 */ 79 79 function WP_List_Table( $args = array() ) { 80 80 $args = wp_parse_args( $args, array( 81 'screen' => get_current_screen(),82 81 'plural' => '', 83 82 'singular' => '', 84 83 'ajax' => true 85 84 ) ); 86 85 87 $this->screen = $args['screen'];86 add_filter( 'manage_' . get_current_screen()->id . '_columns', array( &$this, 'get_columns' ), 0 ); 88 87 89 if ( is_string( $this->screen ) )90 $this->screen = convert_to_screen( $this->screen );91 92 add_filter( 'manage_' . $this->screen->id . '_columns', array( &$this, 'get_columns' ), 0 );93 94 88 if ( !$args['plural'] ) 95 $args['plural'] = $this->screen->base;89 $args['plural'] = get_current_screen()->base; 96 90 97 91 $this->_args = $args; 98 92 … … 204 198 */ 205 199 function views() { 206 200 $views = $this->get_views(); 207 $views = apply_filters( 'views_' . $this->screen->id, $views );201 $views = apply_filters( 'views_' . get_current_screen()->id, $views ); 208 202 209 203 if ( empty( $views ) ) 210 204 return; … … 240 234 241 235 if ( is_null( $this->_actions ) ) { 242 236 $this->_actions = $this->get_bulk_actions(); 243 $this->_actions = apply_filters( 'bulk_actions-' . $this->screen->id, $this->_actions );237 $this->_actions = apply_filters( 'bulk_actions-' . get_current_screen()->id, $this->_actions ); 244 238 $two = ''; 245 239 } 246 240 else { … … 538 532 */ 539 533 function get_column_info() { 540 534 if ( !isset( $this->_column_headers ) ) { 541 $columns = get_column_headers( $this->screen);542 $hidden = get_hidden_columns( $this->screen);543 $sortable = apply_filters( 'manage_' . $this->screen->id . '_sortable_columns', $this->get_sortable_columns() );535 $columns = get_column_headers( get_current_screen() ); 536 $hidden = get_hidden_columns( get_current_screen() ); 537 $sortable = apply_filters( 'manage_' . get_current_screen()->id . '_sortable_columns', $this->get_sortable_columns() ); 544 538 545 539 $this->_column_headers = array( $columns, $hidden, $sortable ); 546 540 } … … 557 551 * @param bool $with_id Whether to set the id attribute or not 558 552 */ 559 553 function print_column_headers( $with_id = true ) { 560 $screen = $this->screen;554 $screen = get_current_screen(); 561 555 562 556 list( $columns, $hidden, $sortable ) = $this->get_column_info(); 563 557 … … 810 804 function _js_vars() { 811 805 $args = array( 812 806 'class' => get_class( $this ), 813 'screen' => $this->screen807 'screen' => get_current_screen() 814 808 ); 815 809 816 810 printf( "<script type='text/javascript'>list_args = %s;</script>\n", json_encode( $args ) ); -
wp-admin/includes/deprecated.php
721 721 722 722 global $wp_list_table; 723 723 if ( !is_a($wp_list_table, 'WP_List_Table') ) 724 $wp_list_table = new _WP_List_Table_Compat( $screen);724 $wp_list_table = new _WP_List_Table_Compat(); 725 725 726 726 $wp_list_table->print_column_headers($id); 727 727 } … … 731 731 732 732 var $_columns = array(); 733 733 734 function _WP_List_Table_Compat( $screen) {734 function _WP_List_Table_Compat() { 735 735 parent::WP_List_Table( array( 736 'screen' => $screen,737 736 'ajax' => false 738 737 ) ); 739 738 } -
wp-admin/includes/class-wp-plugins-list-table.php
57 57 'dropins' => array() 58 58 ); 59 59 60 if ( ! is_multisite() || ( $this->screen->is_network && current_user_can('manage_network_plugins') ) ) {60 if ( ! is_multisite() || ( get_current_screen()->is_network && current_user_can('manage_network_plugins') ) ) { 61 61 if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) ) 62 62 $plugins['mustuse'] = get_mu_plugins(); 63 63 if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) ) … … 85 85 86 86 foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) { 87 87 // Filter into individual sections 88 if ( is_plugin_active_for_network($plugin_file) && ! $this->screen->is_network ) {88 if ( is_plugin_active_for_network($plugin_file) && !get_current_screen()->is_network ) { 89 89 unset( $plugins['all'][ $plugin_file ] ); 90 90 continue; 91 91 } elseif ( is_multisite() && is_network_only_plugin( $plugin_file ) && !current_user_can( 'manage_network_plugins' ) ) { 92 92 $plugins['network'][ $plugin_file ] = $plugin_data; 93 } elseif ( ( ! $this->screen->is_network && is_plugin_active( $plugin_file ) )94 || ( $this->screen->is_network && is_plugin_active_for_network( $plugin_file ) ) ) {93 } elseif ( ( !get_current_screen()->is_network && is_plugin_active( $plugin_file ) ) 94 || ( get_current_screen()->is_network && is_plugin_active_for_network( $plugin_file ) ) ) { 95 95 $plugins['active'][ $plugin_file ] = $plugin_data; 96 96 } else { 97 if ( ! $this->screen->is_network && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?97 if ( !get_current_screen()->is_network && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated? 98 98 $plugins['recently_activated'][ $plugin_file ] = $plugin_data; 99 99 $plugins['inactive'][ $plugin_file ] = $plugin_data; 100 100 } … … 128 128 uasort( $this->items, array( &$this, '_order_callback' ) ); 129 129 } 130 130 131 $plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page") );131 $plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', get_current_screen()->id . '_per_page' ) ); 132 132 133 133 $start = ( $page - 1 ) * $plugins_per_page; 134 134 … … 254 254 $actions = array(); 255 255 256 256 if ( 'active' != $status ) { 257 $action = $this->screen->is_network ? 'network-activate-selected' : 'activate-selected';257 $action = get_current_screen()->is_network ? 'network-activate-selected' : 'activate-selected'; 258 258 $actions[ $action ] = __( 'Activate' ); 259 259 } 260 260 261 261 if ( 'inactive' != $status && 'recent' != $status ) 262 262 $actions['deactivate-selected'] = __( 'Deactivate' ); 263 263 264 if ( !is_multisite() || $this->screen->is_network ) {264 if ( !is_multisite() || get_current_screen()->is_network ) { 265 265 if ( current_user_can( 'update_plugins' ) ) 266 266 $actions['update-selected'] = __( 'Update' ); 267 267 if ( current_user_can( 'delete_plugins' ) && ( 'active' != $status ) ) … … 313 313 ); 314 314 315 315 if ( 'mustuse' == $context ) { 316 if ( is_multisite() && ! $this->screen->is_network )316 if ( is_multisite() && !get_current_screen()->is_network ) 317 317 continue; 318 318 $is_active = true; 319 319 } elseif ( 'dropins' == $context ) { 320 if ( is_multisite() && ! $this->screen->is_network )320 if ( is_multisite() && !get_current_screen()->is_network ) 321 321 continue; 322 322 $dropins = _get_dropins(); 323 323 $plugin_name = $plugin_file; … … 337 337 $description .= '<p>' . $plugin_data['Description'] . '</p>'; 338 338 } else { 339 339 $is_active_for_network = is_plugin_active_for_network($plugin_file); 340 if ( $this->screen->is_network )340 if ( get_current_screen()->is_network ) 341 341 $is_active = $is_active_for_network; 342 342 else 343 343 $is_active = is_plugin_active( $plugin_file ); 344 344 345 if ( $is_active_for_network && !is_super_admin() && ! $this->screen->is_network )345 if ( $is_active_for_network && !is_super_admin() && !get_current_screen()->is_network ) 346 346 continue; 347 347 348 if ( $this->screen->is_network ) {348 if ( get_current_screen()->is_network ) { 349 349 if ( $is_active_for_network ) { 350 350 if ( current_user_can( 'manage_network_plugins' ) ) 351 351 $actions['network_deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&networkwide=1&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Network Deactivate') . '</a>'; … … 359 359 if ( $is_active ) { 360 360 $actions['deactivate'] = '<a href="' . wp_nonce_url('plugins.php?action=deactivate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'deactivate-plugin_' . $plugin_file) . '" title="' . __('Deactivate this plugin') . '">' . __('Deactivate') . '</a>'; 361 361 } else { 362 if ( is_network_only_plugin( $plugin_file ) && ! $this->screen->is_network )362 if ( is_network_only_plugin( $plugin_file ) && !get_current_screen()->is_network ) 363 363 continue; 364 364 365 365 $actions['activate'] = '<a href="' . wp_nonce_url('plugins.php?action=activate&plugin=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'activate-plugin_' . $plugin_file) . '" title="' . __('Activate this plugin') . '" class="edit">' . __('Activate') . '</a>'; … … 367 367 if ( ! is_multisite() && current_user_can('delete_plugins') ) 368 368 $actions['delete'] = '<a href="' . wp_nonce_url('plugins.php?action=delete-selected&checked[]=' . $plugin_file . '&plugin_status=' . $context . '&paged=' . $page . '&s=' . $s, 'bulk-plugins') . '" title="' . __('Delete this plugin') . '" class="delete">' . __('Delete') . '</a>'; 369 369 } // end if $is_active 370 } // end if $this->screen->is_network370 } // end if get_current_screen()->is_network 371 371 372 372 if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) ) 373 373 $actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>'; -
wp-admin/includes/class-wp-comments-list-table.php
30 30 add_filter( 'comment_author', 'floated_admin_avatar' ); 31 31 32 32 parent::WP_List_Table( array( 33 'screen' => 'edit-comments',34 33 'plural' => 'comments' 35 34 ) ); 36 35 }