WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/23/2012 09:41:00 PM (9 years ago)
Author:
azaozz
Message:

Responsive columns on the dashboard and write screens, first run, see #20015

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/dashboard.php

    r20168 r20272  
    197197
    198198    $screen = get_current_screen();
    199 
    200     $hide2 = $hide3 = $hide4 = '';
    201     switch ( $screen_layout_columns ) {
    202         case 4:
    203             $width = 'width:25%;';
    204             break;
    205         case 3:
    206             $width = 'width:33.333333%;';
    207             $hide4 = 'display:none;';
    208             break;
    209         case 2:
    210             $width = 'width:50%;';
    211             $hide3 = $hide4 = 'display:none;';
    212             break;
    213         default:
    214             $width = 'width:100%;';
    215             $hide2 = $hide3 = $hide4 = 'display:none;';
    216     }
     199    $class = 'columns-' . $screen_layout_columns;
     200
    217201?>
    218 <div id="dashboard-widgets" class="metabox-holder">
    219 <?php
    220     echo "\t<div id='postbox-container-1' class='postbox-container' style='$width'>\n";
    221     do_meta_boxes( $screen->id, 'normal', '' );
    222 
    223     echo "\t</div><div id='postbox-container-2' class='postbox-container' style='{$hide2}$width'>\n";
    224     do_meta_boxes( $screen->id, 'side', '' );
    225 
    226     echo "\t</div><div id='postbox-container-3' class='postbox-container' style='{$hide3}$width'>\n";
    227     do_meta_boxes( $screen->id, 'column3', '' );
    228 
    229     echo "\t</div><div id='postbox-container-4' class='postbox-container' style='{$hide4}$width'>\n";
    230     do_meta_boxes( $screen->id, 'column4', '' );
    231 ?>
    232 </div></div>
    233 
    234 <form style="display:none" method="get" action="">
    235     <p>
     202<div id="dashboard-widgets" class="metabox-holder <?php echo $class; ?>">
     203    <div id='postbox-container-1' class='postbox-container'>
     204    <?php do_meta_boxes( $screen->id, 'normal', '' ); ?>
     205    </div>
     206    <div id='postbox-container-2' class='postbox-container'>
     207    <?php do_meta_boxes( $screen->id, 'side', '' ); ?>
     208    </div>
     209    <div id='postbox-container-3' class='postbox-container'>
     210    <?php do_meta_boxes( $screen->id, 'column3', '' ); ?>
     211    </div>
     212    <div id='postbox-container-4' class='postbox-container'>
     213    <?php do_meta_boxes( $screen->id, 'column4', '' ); ?>
     214    </div>
     215</div>
     216
    236217<?php
    237218    wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
    238219    wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', false );
    239 ?>
    240     </p>
    241 </form>
    242 
    243 <?php
     220
    244221}
    245222
Note: See TracChangeset for help on using the changeset viewer.