Ticket #20506: edit-form-fix.2.diff
File edit-form-fix.2.diff, 5.4 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/screen.php
773 773 </div> 774 774 </div> 775 775 <?php 776 // Get the screen layout since we need it for class identifiers 777 $this->get_screen_layout(); 778 776 779 // Add screen options 777 780 if ( $this->show_screen_options() ) 778 781 $this->render_screen_options(); … … 902 905 } 903 906 904 907 /** 905 * Render the option for number of columns on the page908 * Render the HTML for the number of columns on the page. 906 909 * 907 910 * @since 3.3.0 911 * 912 * @global int $screen_layout_columns The number of columns on the page 908 913 */ 909 914 function render_screen_layout() { 910 915 global $screen_layout_columns; 916 $num = $this->get_option( 'layout_columns', 'max' ); 917 ?> 918 <h5 class="screen-layout"><?php _e('Screen Layout'); ?></h5> 919 <div class='columns-prefs'><?php 920 _e('Number of Columns:'); 921 for ( $i = 1; $i <= $num; ++$i ): 922 ?> 923 <label class="columns-prefs-<?php echo $i; ?>"> 924 <input type='radio' name='screen_columns' value='<?php echo esc_attr( $i ); ?>' 925 <?php checked( $screen_layout_columns, $i ); ?> /> 926 <?php echo esc_html( $i ); ?> 927 </label> 928 <?php 929 endfor; ?> 930 </div> 931 <?php 932 } 933 934 /** 935 * Set up the global $screen_layout_columns to determine the number of metabox 936 * columns on the page. 937 * 938 * @since 3.4.0 939 * 940 * @global int $screen_layout_columns The number of columns on the page 941 */ 942 function get_screen_layout() { 943 944 global $screen_layout_columns; 911 945 912 946 // Back compat for plugins using the filter instead of add_screen_option() 913 947 $columns = apply_filters( 'screen_layout_columns', array(), $this->id, $this ); … … 921 955 } 922 956 923 957 $screen_layout_columns = get_user_option("screen_layout_$this->id"); 924 $num = $this->get_option( 'layout_columns', 'max' );925 958 926 959 if ( ! $screen_layout_columns || 'auto' == $screen_layout_columns ) { 927 960 if ( $this->get_option( 'layout_columns', 'default' ) ) 928 961 $screen_layout_columns = $this->get_option( 'layout_columns', 'default' ); 929 962 } 930 931 ?> 932 <h5 class="screen-layout"><?php _e('Screen Layout'); ?></h5> 933 <div class='columns-prefs'><?php 934 _e('Number of Columns:'); 935 for ( $i = 1; $i <= $num; ++$i ): 936 ?> 937 <label class="columns-prefs-<?php echo $i; ?>"> 938 <input type='radio' name='screen_columns' value='<?php echo esc_attr( $i ); ?>' 939 <?php checked( $screen_layout_columns, $i ); ?> /> 940 <?php echo esc_html( $i ); ?> 941 </label> 942 <?php 943 endfor; ?> 944 </div> 945 <?php 963 964 /** Have the method return the number of columns as well */ 965 return $screen_layout_columns; 966 946 967 } 947 968 948 969 /** -
wp-admin/edit-form-advanced.php
243 243 require_once('./admin-header.php'); 244 244 ?> 245 245 246 <div class="wrap columns-<?php echo (int) $screen_layout_columns? (int) $screen_layout_columns : 'auto'; ?>">246 <div class="wrap columns-<?php echo !empty( $screen_layout_columns ) ? (int) $screen_layout_columns : 'auto'; ?>"> 247 247 <?php screen_icon(); ?> 248 248 <h2><?php echo esc_html( $title ); ?><?php if ( isset( $post_new_file ) ) : ?> <a href="<?php echo esc_url( $post_new_file ) ?>" class="add-new-h2"><?php echo esc_html($post_type_object->labels->add_new); ?></a><?php endif; ?></h2> 249 249 <?php if ( $notice ) : ?> … … 277 277 278 278 <div id="poststuff"> 279 279 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 !empty( $screen_layout_columns ) && 1 == $screen_layout_columns ? '1' : '2'; ?>"> 281 281 <div id="post-body-content"> 282 282 <?php if ( post_type_supports($post_type, 'title') ) { ?> 283 283 <div id="titlediv"> -
wp-admin/edit-link-form.php
57 57 require_once ('admin-header.php'); 58 58 ?> 59 59 60 <div class="wrap columns-<?php echo (int) $screen_layout_columns? (int) $screen_layout_columns : 'auto'; ?>">60 <div class="wrap columns-<?php echo !empty( $screen_layout_columns ) ? (int) $screen_layout_columns : 'auto'; ?>"> 61 61 <?php screen_icon(); ?> 62 62 <h2><?php echo esc_html( $title ); ?> <a href="link-add.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'link'); ?></a></h2> 63 63 … … 77 77 78 78 <div id="poststuff"> 79 79 80 <div id="post-body" class="metabox-holder columns-<?php echo 1 == $screen_layout_columns ? '1' : '2'; ?>">80 <div id="post-body" class="metabox-holder columns-<?php echo !empty( $screen_layout_columns ) && 1 == $screen_layout_columns ? '1' : '2'; ?>"> 81 81 <div id="post-body-content"> 82 82 <div id="namediv" class="stuffbox"> 83 83 <h3><label for="link_name"><?php _ex('Name', 'link name') ?></label></h3> -
wp-admin/includes/dashboard.php
196 196 global $screen_layout_columns; 197 197 198 198 $screen = get_current_screen(); 199 $class = 'columns-' . $screen_layout_columns; 199 if ( !empty( $screen_layout_columns ) ) 200 $class = 'columns-' . $screen_layout_columns; 200 201 201 202 ?> 202 203 <div id="dashboard-widgets" class="metabox-holder <?php echo $class; ?>">