Rename property _screen to screen. See #14579
git-svn-id: https://develop.svn.wordpress.org/trunk@16195 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
393bdc04e3
commit
419c42838b
@ -48,9 +48,9 @@ class WP_List_Table {
|
||||
*
|
||||
* @since 3.1.0
|
||||
* @var object
|
||||
* @access private
|
||||
* @access protected
|
||||
*/
|
||||
var $_screen;
|
||||
var $screen;
|
||||
|
||||
/**
|
||||
* Cached bulk actions
|
||||
@ -84,15 +84,15 @@ class WP_List_Table {
|
||||
'ajax' => true
|
||||
) );
|
||||
|
||||
$this->_screen = $args['screen'];
|
||||
$this->screen = $args['screen'];
|
||||
|
||||
if ( is_string( $this->_screen ) )
|
||||
$this->_screen = convert_to_screen( $this->_screen );
|
||||
if ( is_string( $this->screen ) )
|
||||
$this->screen = convert_to_screen( $this->screen );
|
||||
|
||||
add_filter( 'manage_' . $this->_screen->id . '_columns', array( &$this, 'get_columns' ), 0 );
|
||||
add_filter( 'manage_' . $this->screen->id . '_columns', array( &$this, 'get_columns' ), 0 );
|
||||
|
||||
if ( !$args['plural'] )
|
||||
$args['plural'] = $this->_screen->base;
|
||||
$args['plural'] = $this->screen->base;
|
||||
|
||||
$this->_args = $args;
|
||||
|
||||
@ -204,7 +204,7 @@ class WP_List_Table {
|
||||
*/
|
||||
function views() {
|
||||
$views = $this->get_views();
|
||||
$views = apply_filters( 'views_' . $this->_screen->base, $views );
|
||||
$views = apply_filters( 'views_' . $this->screen->base, $views );
|
||||
|
||||
if ( empty( $views ) )
|
||||
return;
|
||||
@ -237,7 +237,7 @@ class WP_List_Table {
|
||||
|
||||
if ( is_null( $this->_actions ) ) {
|
||||
$this->_actions = $this->get_bulk_actions();
|
||||
$this->_actions = apply_filters( 'bulk_actions-' . $this->_screen->base, $this->_actions );
|
||||
$this->_actions = apply_filters( 'bulk_actions-' . $this->screen->base, $this->_actions );
|
||||
$two = '';
|
||||
}
|
||||
else {
|
||||
@ -535,9 +535,9 @@ class WP_List_Table {
|
||||
*/
|
||||
function get_column_info() {
|
||||
if ( !isset( $this->_column_headers ) ) {
|
||||
$columns = get_column_headers( $this->_screen );
|
||||
$hidden = get_hidden_columns( $this->_screen );
|
||||
$sortable = apply_filters( 'manage_' . $this->_screen->id . '_sortable_columns', $this->get_sortable_columns() );
|
||||
$columns = get_column_headers( $this->screen );
|
||||
$hidden = get_hidden_columns( $this->screen );
|
||||
$sortable = apply_filters( 'manage_' . $this->screen->id . '_sortable_columns', $this->get_sortable_columns() );
|
||||
|
||||
$this->_column_headers = array( $columns, $hidden, $sortable );
|
||||
}
|
||||
@ -554,7 +554,7 @@ class WP_List_Table {
|
||||
* @param bool $with_id Whether to set the id attribute or not
|
||||
*/
|
||||
function print_column_headers( $with_id = true ) {
|
||||
$screen = $this->_screen;
|
||||
$screen = $this->screen;
|
||||
|
||||
list( $columns, $hidden, $sortable ) = $this->get_column_info();
|
||||
|
||||
@ -807,7 +807,7 @@ class WP_List_Table {
|
||||
function _js_vars() {
|
||||
$args = array(
|
||||
'class' => get_class( $this ),
|
||||
'screen' => $this->_screen
|
||||
'screen' => $this->screen
|
||||
);
|
||||
|
||||
printf( "<script type='text/javascript'>list_args = %s;</script>\n", json_encode( $args ) );
|
||||
|
@ -151,13 +151,13 @@ class WP_Media_List_Table extends WP_List_Table {
|
||||
$posts_columns['author'] = __( 'Author' );
|
||||
//$posts_columns['tags'] = _x( 'Tags', 'column name' );
|
||||
/* translators: column name */
|
||||
if ( 'upload' == $this->_screen->id ) {
|
||||
if ( 'upload' == $this->screen->id ) {
|
||||
$posts_columns['parent'] = _x( 'Attached to', 'column name' );
|
||||
$posts_columns['comments'] = '<div class="vers"><img alt="Comments" src="' . esc_url( admin_url( 'images/comment-grey-bubble.png' ) ) . '" /></div>';
|
||||
}
|
||||
/* translators: column name */
|
||||
$posts_columns['date'] = _x( 'Date', 'column name' );
|
||||
$posts_columns = apply_filters( 'manage_media_columns', $posts_columns, 'upload' != $this->_screen->id );
|
||||
$posts_columns = apply_filters( 'manage_media_columns', $posts_columns, 'upload' != $this->screen->id );
|
||||
|
||||
return $posts_columns;
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
'dropins' => array()
|
||||
);
|
||||
|
||||
if ( ! is_multisite() || ( $this->_screen->is_network && current_user_can('manage_network_plugins') ) ) {
|
||||
if ( ! is_multisite() || ( $this->screen->is_network && current_user_can('manage_network_plugins') ) ) {
|
||||
if ( apply_filters( 'show_advanced_plugins', true, 'mustuse' ) )
|
||||
$plugins['mustuse'] = get_mu_plugins();
|
||||
if ( apply_filters( 'show_advanced_plugins', true, 'dropins' ) )
|
||||
@ -85,16 +85,16 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
|
||||
foreach ( (array) $plugins['all'] as $plugin_file => $plugin_data ) {
|
||||
// Filter into individual sections
|
||||
if ( is_plugin_active_for_network($plugin_file) && !$this->_screen->is_network ) {
|
||||
if ( is_plugin_active_for_network($plugin_file) && !$this->screen->is_network ) {
|
||||
unset( $plugins['all'][ $plugin_file ] );
|
||||
continue;
|
||||
} elseif ( is_multisite() && is_network_only_plugin( $plugin_file ) && !current_user_can( 'manage_network_plugins' ) ) {
|
||||
$plugins['network'][ $plugin_file ] = $plugin_data;
|
||||
} elseif ( ( !$this->_screen->is_network && is_plugin_active( $plugin_file ) )
|
||||
|| ( $this->_screen->is_network && is_plugin_active_for_network( $plugin_file ) ) ) {
|
||||
} elseif ( ( !$this->screen->is_network && is_plugin_active( $plugin_file ) )
|
||||
|| ( $this->screen->is_network && is_plugin_active_for_network( $plugin_file ) ) ) {
|
||||
$plugins['active'][ $plugin_file ] = $plugin_data;
|
||||
} else {
|
||||
if ( !$this->_screen->is_network && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
|
||||
if ( !$this->screen->is_network && isset( $recently_activated[ $plugin_file ] ) ) // Was the plugin recently activated?
|
||||
$plugins['recently_activated'][ $plugin_file ] = $plugin_data;
|
||||
$plugins['inactive'][ $plugin_file ] = $plugin_data;
|
||||
}
|
||||
@ -128,7 +128,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
uasort( $this->items, array( &$this, '_order_callback' ) );
|
||||
}
|
||||
|
||||
$plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->_screen->id}_per_page" ) );
|
||||
$plugins_per_page = $this->get_items_per_page( str_replace( '-', '_', "{$this->screen->id}_per_page" ) );
|
||||
|
||||
$start = ( $page - 1 ) * $plugins_per_page;
|
||||
|
||||
@ -254,14 +254,14 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
$actions = array();
|
||||
|
||||
if ( 'active' != $status ) {
|
||||
$action = $this->_screen->is_network ? 'network-activate-selected' : 'activate-selected';
|
||||
$action = $this->screen->is_network ? 'network-activate-selected' : 'activate-selected';
|
||||
$actions[ $action ] = __( 'Activate' );
|
||||
}
|
||||
|
||||
if ( 'inactive' != $status && 'recent' != $status )
|
||||
$actions['deactivate-selected'] = __( 'Deactivate' );
|
||||
|
||||
if ( !is_multisite() || $this->_screen->is_network ) {
|
||||
if ( !is_multisite() || $this->screen->is_network ) {
|
||||
if ( current_user_can( 'update_plugins' ) )
|
||||
$actions['update-selected'] = __( 'Update' );
|
||||
if ( current_user_can( 'delete_plugins' ) && ( 'active' != $status ) )
|
||||
@ -313,11 +313,11 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
);
|
||||
|
||||
if ( 'mustuse' == $context ) {
|
||||
if ( is_multisite() && !$this->_screen->is_network )
|
||||
if ( is_multisite() && !$this->screen->is_network )
|
||||
continue;
|
||||
$is_active = true;
|
||||
} elseif ( 'dropins' == $context ) {
|
||||
if ( is_multisite() && !$this->_screen->is_network )
|
||||
if ( is_multisite() && !$this->screen->is_network )
|
||||
continue;
|
||||
$dropins = _get_dropins();
|
||||
$plugin_name = $plugin_file;
|
||||
@ -337,15 +337,15 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
$description .= '<p>' . $plugin_data['Description'] . '</p>';
|
||||
} else {
|
||||
$is_active_for_network = is_plugin_active_for_network($plugin_file);
|
||||
if ( $this->_screen->is_network )
|
||||
if ( $this->screen->is_network )
|
||||
$is_active = $is_active_for_network;
|
||||
else
|
||||
$is_active = is_plugin_active( $plugin_file );
|
||||
|
||||
if ( $is_active_for_network && !is_super_admin() && !$this->_screen->is_network )
|
||||
if ( $is_active_for_network && !is_super_admin() && !$this->screen->is_network )
|
||||
continue;
|
||||
|
||||
if ( $this->_screen->is_network ) {
|
||||
if ( $this->screen->is_network ) {
|
||||
if ( $is_active_for_network ) {
|
||||
if ( current_user_can( 'manage_network_plugins' ) )
|
||||
$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,7 +359,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
if ( $is_active ) {
|
||||
$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>';
|
||||
} else {
|
||||
if ( is_network_only_plugin( $plugin_file ) && !$this->_screen->is_network )
|
||||
if ( is_network_only_plugin( $plugin_file ) && !$this->screen->is_network )
|
||||
continue;
|
||||
|
||||
$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,7 +367,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
|
||||
if ( ! is_multisite() && current_user_can('delete_plugins') )
|
||||
$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>';
|
||||
} // end if $is_active
|
||||
} // end if $this->_screen->is_network
|
||||
} // end if $this->screen->is_network
|
||||
|
||||
if ( current_user_can('edit_plugins') && is_writable(WP_PLUGIN_DIR . '/' . $plugin_file) )
|
||||
$actions['edit'] = '<a href="plugin-editor.php?file=' . $plugin_file . '" title="' . __('Open this file in the Plugin Editor') . '" class="edit">' . __('Edit') . '</a>';
|
||||
|
@ -256,7 +256,7 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
}
|
||||
|
||||
function get_columns() {
|
||||
$screen = $this->_screen;
|
||||
$screen = $this->screen;
|
||||
|
||||
if ( empty( $screen ) )
|
||||
$post_type = 'post';
|
||||
@ -675,7 +675,7 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
function inline_edit() {
|
||||
global $mode;
|
||||
|
||||
$screen = $this->_screen;
|
||||
$screen = $this->screen;
|
||||
|
||||
$post = get_default_post_to_edit( $screen->post_type );
|
||||
$post_type_object = get_post_type_object( $screen->post_type );
|
||||
|
Loading…
Reference in New Issue
Block a user