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

@@ -277,7 +277,7 @@ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
<div id="poststuff">
<div id="post-body" class="metabox-holder columns-<?php echo 1 == $screen_layout_columns ? '1' : '2'; ?>">
<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
<div id="post-body-content">
<?php if ( post_type_supports($post_type, 'title') ) { ?>
<div id="titlediv">