Clean out layout columns API in WP_Screen.

* Move layout column setup into render_screen_meta() so that the number of columns is available earlier.
* Store the user provisioned number of columns in an instance var.
* Access the var with get_columns()
* Move all templates away from the screen_layout_columns global to the get_columns() method.
* Deprecate the global
* Remove the no longer needed check for 'auto' in the user option.
* Cast the user option to an int.

Props griffinjt
fixes #20506


git-svn-id: http://svn.automattic.com/wordpress/trunk@20579 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2012-04-24 20:46:04 +00:00
parent f92e8411f8
commit df7bd632f2
4 changed files with 48 additions and 23 deletions

View File

@@ -193,10 +193,8 @@ function _wp_dashboard_control_callback( $dashboard, $meta_box ) {
* @since 2.5.0
*/
function wp_dashboard() {
global $screen_layout_columns;
$screen = get_current_screen();
$class = 'columns-' . $screen_layout_columns;
$class = 'columns-' . get_current_screen()->get_columns();
?>
<div id="dashboard-widgets" class="metabox-holder <?php echo $class; ?>">