Let plugins use screen layout columns, props arena, fixes #9606
git-svn-id: http://svn.automattic.com/wordpress/trunk@11144 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
36eee06eb3
commit
adc787372e
|
@ -3586,27 +3586,16 @@ function widgets_help() {
|
||||||
function screen_layout($screen) {
|
function screen_layout($screen) {
|
||||||
global $screen_layout_columns;
|
global $screen_layout_columns;
|
||||||
|
|
||||||
switch ( $screen ) {
|
$columns = array('dashboard' => 4, 'post' => 2, 'page' => 2, 'link' => 2);
|
||||||
case 'dashboard':
|
$columns = apply_filters('screen_layout_columns', $columns, $screen);
|
||||||
$screen_layout_columns = get_user_option('screen_layout_dashboard');
|
|
||||||
$num = 4;
|
if ( !isset($columns[$screen]) ) {
|
||||||
break;
|
$screen_layout_columns = 0;
|
||||||
case 'post':
|
return '';
|
||||||
$screen_layout_columns = get_user_option('screen_layout_post');
|
}
|
||||||
$num = 2;
|
|
||||||
break;
|
$screen_layout_columns = get_user_option("screen_layout_$screen");
|
||||||
case 'page':
|
$num = $columns[$screen];
|
||||||
$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 '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ! $screen_layout_columns )
|
if ( ! $screen_layout_columns )
|
||||||
$screen_layout_columns = 2;
|
$screen_layout_columns = 2;
|
||||||
|
|
Loading…
Reference in New Issue