Favorite action for network admin. see #14435

git-svn-id: http://svn.automattic.com/wordpress/trunk@15489 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2010-08-02 19:07:03 +00:00
parent 11dc4a27bc
commit 10deff9e1d
2 changed files with 55 additions and 42 deletions

View File

@ -153,7 +153,7 @@ echo implode(' ', $links);
?></p>
</div>
<?php !is_network_admin() ? favorite_actions($current_screen) : ''; ?>
<?php favorite_actions($current_screen); ?>
</div>
</div>

View File

@ -3326,6 +3326,9 @@ function favorite_actions( $screen = null ) {
}
if ( !$default_action ) {
if ( $screen->is_network ) {
$default_action = array('sites.php' => array( __('Sites'), 'manage_sites'));
} else {
switch ( $screen->id ) {
case 'upload':
$default_action = array('media-new.php' => array(__('New Media'), 'upload_files'));
@ -3363,7 +3366,9 @@ function favorite_actions( $screen = null ) {
break;
}
}
}
if ( !$screen->is_network ) {
$actions = array(
'post-new.php' => array(__('New Post'), 'edit_posts'),
'edit.php?post_status=draft' => array(__('Drafts'), 'edit_posts'),
@ -3371,6 +3376,12 @@ function favorite_actions( $screen = null ) {
'media-new.php' => array(__('Upload'), 'upload_files'),
'edit-comments.php' => array(__('Comments'), 'moderate_comments')
);
} else {
$actions = array(
'sites.php' => array( __('Sites'), 'manage_sites'),
'users.php' => array( __('Users'), 'manage_network_users')
);
}
$default_key = array_keys($default_action);
$default_key = $default_key[0];
@ -3946,6 +3957,8 @@ function set_current_screen( $id = '' ) {
$current_screen->taxonomy = $taxnow;
}
$current_screen->is_network = is_network_admin() ? true : false;
$current_screen = apply_filters('current_screen', $current_screen);
}