[wp-trac] [WordPress Trac] #9606: screen_layout for plugins

WordPress Trac wp-trac at lists.automattic.com
Tue Apr 21 09:30:24 GMT 2009


#9606: screen_layout for plugins
-----------------------------+----------------------------------------------
 Reporter:  arena            |       Owner:  anonymous
     Type:  feature request  |      Status:  new      
 Priority:  normal           |   Milestone:  2.8      
Component:  Administration   |     Version:           
 Severity:  normal           |    Keywords:  has-patch
-----------------------------+----------------------------------------------
 In order to allow plugins to integrate this new wp feature !


 {{{
 function screen_layout($screen) {
         global $screen_layout_columns;

         switch ( $screen ) {
                 case 'dashboard':
                         $screen_layout_columns =
 get_user_option('screen_layout_dashboard');
                         $num = 4;
                         break;
                 case 'post':
                         $screen_layout_columns =
 get_user_option('screen_layout_post');
                         $num = 2;
                         break;
                 case 'page':
                         $screen_layout_columns =
 get_user_option('screen_layout_page');
                         $num = 2;
                         break;
                 case 'link':
                         $screen_layout_columns =
 get_user_option('screen_layout_link');
                         $num = 2;
                         break;
                 default:
                         $screen_layout_columns = 0;
                         return '';
         }

 // the following test is useless !
         if ( ! $screen_layout_columns )
                         $screen_layout_columns = 2;

         $i = 1;
 }}}

 to be replaced by


 {{{
 function screen_layout($screen) {
         global $screen_layout_columns;

         $wp_screen_layouts = array('dashboard' => 4, 'post' => 2, 'page'
 => 2, 'link' => 2);

         $wp_screen_layouts = apply_filters('screen_layout',
 $wp_screen_layouts, $screen);

         if (!isset($wp_screen_layouts[$screen])) {
                 $screen_layout_columns = 0;
                 return '';
         }

         $screen_layout_columns = get_user_option("screen_layout_$screen");
         $num = $wp_screen_layouts[$screen];

         $i = 1;
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9606>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list