Make WordPress Core


Ignore:
Timestamp:
04/24/2012 08:46:04 PM (13 years ago)
Author:
ryan
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r20570 r20579  
    278278<div id="poststuff">
    279279
    280 <div id="post-body" class="metabox-holder columns-<?php echo 1 == $screen_layout_columns ? '1' : '2'; ?>">
     280<div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
    281281<div id="post-body-content">
    282282<?php if ( post_type_supports($post_type, 'title') ) { ?>
Note: See TracChangeset for help on using the changeset viewer.