Move all new WP_Screen properties to private. We should introduce getters. Correct legacy (and ideally read-only) properties to @access public. see #18785.

git-svn-id: https://develop.svn.wordpress.org/trunk@18857 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2011-10-01 17:59:46 +00:00
parent 3985ff6af3
commit c0b2567366
1 changed files with 30 additions and 30 deletions

View File

@ -400,7 +400,7 @@ final class WP_Screen {
*
* @since 3.3.0
* @var string
* @access private
* @access public
*/
public $action = '';
@ -410,7 +410,7 @@ final class WP_Screen {
*
* @since 3.3.0
* @var string
* @access private
* @access public
*/
public $base;
@ -419,7 +419,7 @@ final class WP_Screen {
*
* @since 3.3.0
* @var string
* @access private
* @access public
*/
public $id;
@ -428,7 +428,7 @@ final class WP_Screen {
*
* @since 3.3.0
* @var bool
* @access private
* @access public
*/
public $is_network;
@ -437,7 +437,7 @@ final class WP_Screen {
*
* @since 3.3.0
* @var bool
* @access private
* @access public
*/
public $is_user;
@ -448,7 +448,7 @@ final class WP_Screen {
*
* @since 3.3.0
* @var string
* @access private
* @access public
*/
public $parent_base;
@ -458,7 +458,7 @@ final class WP_Screen {
*
* @since 3.3.0
* @var string
* @access private
* @access public
*/
public $parent_file;
@ -468,7 +468,7 @@ final class WP_Screen {
*
* @since 3.3.0
* @var string
* @access private
* @access public
*/
public $post_type;
@ -477,7 +477,7 @@ final class WP_Screen {
* The 'edit-tags.php?taxonomy=category' screen has a taxonomy of 'category'.
* @since 3.3.0
* @var string
* @access private
* @access public
*/
public $taxonomy;
@ -488,7 +488,7 @@ final class WP_Screen {
* @var array
* @access private
*/
public $help_tabs = array();
private $_help_tabs = array();
/**
* The help sidebar data associated with the screen, if any.
@ -497,7 +497,7 @@ final class WP_Screen {
* @var string
* @access private
*/
public $help_sidebar = '';
private $_help_sidebar = '';
/**
* The screen options associated with the screen, if any.
@ -506,7 +506,7 @@ final class WP_Screen {
* @var array
* @access private
*/
public $options = array();
private $_options = array();
/**
@ -621,7 +621,7 @@ final class WP_Screen {
* @param array $args Associative array of arguments particular to the given $option.
*/
public function add_option( $option, $args = array() ) {
$this->options[ $option ] = $args;
$this->_options[ $option ] = $args;
}
/**
@ -654,7 +654,7 @@ final class WP_Screen {
if ( ! $args['id'] )
$args['id'] = sanitize_html_class( $args['title'] );
$this->help_tabs[] = $args;
$this->_help_tabs[] = $args;
}
/**
@ -666,7 +666,7 @@ final class WP_Screen {
* @param string $content Sidebar content in plain text or HTML.
*/
public function add_help_sidebar( $content ) {
$this->help_sidebar = $content;
$this->_help_sidebar = $content;
}
/**
@ -707,7 +707,7 @@ final class WP_Screen {
<div id="screen-meta" class='metabox-prefs'>
<div id="contextual-help-wrap" class="hidden">
<ul class="contextual-help-tabs">
<?php foreach ( $this->help_tabs as $i => $tab ):
<?php foreach ( $this->_help_tabs as $i => $tab ):
$link_id = "tab-link-{$tab['id']}";
$panel_id = "tab-panel-{$tab['id']}";
$classes = ( $i == 0 ) ? 'active' : '';
@ -722,11 +722,11 @@ final class WP_Screen {
</ul>
<div class="contextual-help-sidebar">
<?php echo $this->help_sidebar; ?>
<?php echo $this->_help_sidebar; ?>
</div>
<div class="contextual-help-tabs-wrap">
<?php foreach ( $this->help_tabs as $i => $tab ):
<?php foreach ( $this->_help_tabs as $i => $tab ):
$panel_id = "tab-panel-{$tab['id']}";
$classes = ( $i == 0 ) ? 'active' : '';
$classes .= ' help-tab-content';
@ -763,7 +763,7 @@ final class WP_Screen {
$show_screen = true;
// Check if there are per-page options.
$show_screen = $show_screen || isset( $this->options['per_page'] );
$show_screen = $show_screen || isset( $this->_options['per_page'] );
$this->_screen_settings = apply_filters( 'screen_settings', '', $this );
@ -777,7 +777,7 @@ final class WP_Screen {
if ( ! empty( $this->_screen_settings ) )
$show_screen = true;
if ( ! empty( $this->options ) )
if ( ! empty( $this->_options ) )
$show_screen = true;
$this->_show_screen_options = apply_filters( 'screen_options_show_screen', $show_screen, $this );
@ -848,17 +848,17 @@ final class WP_Screen {
if ( ! empty( $columns ) && isset( $columns[ $this->id ] ) )
add_screen_option( 'layout_columns', array('max' => $columns[ $this->id ] ) );
if ( ! isset( $this->options['layout_columns'] ) ) {
if ( ! isset( $this->_options['layout_columns'] ) ) {
$screen_layout_columns = 0;
return;
}
$screen_layout_columns = get_user_option("screen_layout_$this->id");
$num = $this->options['layout_columns']['max'];
$num = $this->_options['layout_columns']['max'];
if ( ! $screen_layout_columns ) {
if ( isset( $this->options['layout_columns']['default'] ) )
$screen_layout_columns = $this->options['layout_columns']['default'];
if ( isset( $this->_options['layout_columns']['default'] ) )
$screen_layout_columns = $this->_options['layout_columns']['default'];
else
$screen_layout_columns = 'auto';
}
@ -886,21 +886,21 @@ final class WP_Screen {
}
function render_per_page_options() {
if ( ! isset( $this->options['per_page'] ) )
if ( ! isset( $this->_options['per_page'] ) )
return;
$per_page_label = $this->options['per_page']['label'];
$per_page_label = $this->_options['per_page']['label'];
if ( empty( $this->options['per_page']['option'] ) ) {
if ( empty( $this->_options['per_page']['option'] ) ) {
$option = str_replace( '-', '_', "{$this->id}_per_page" );
} else {
$option = $this->options['per_page']['option'];
$option = $this->_options['per_page']['option'];
}
$per_page = (int) get_user_option( $option );
if ( empty( $per_page ) || $per_page < 1 ) {
if ( isset($this->options['per_page']['default']) )
$per_page = $this->options['per_page']['default'];
if ( isset($this->_options['per_page']['default']) )
$per_page = $this->_options['per_page']['default'];
else
$per_page = 20;
}