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: https://develop.svn.wordpress.org/trunk@20579 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2012-04-24 20:46:04 +00:00
parent 1235945716
commit d04dbfb0e5
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; ?>">