Remove favorite_actions() from h2s. Restore Add New buttons. see #17324

git-svn-id: http://svn.automattic.com/wordpress/trunk@17849 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2011-05-10 19:18:16 +00:00
parent 6e356e3b0a
commit e5ec44416a
10 changed files with 42 additions and 53 deletions

View File

@ -190,9 +190,7 @@ require_once('./admin-header.php');
?> ?>
<div class="wrap"> <div class="wrap">
<?php screen_icon(); ?> <?php screen_icon(); ?>
<h2><?php <h2><?php echo esc_html( $post_type_object->labels->name ); ?> <a href="<?php echo $post_new_file ?>" class="button add-new-h2"><?php echo esc_html($post_type_object->labels->add_new); ?></a> <?php
echo esc_html( $post_type_object->labels->name );
favorite_actions( $current_screen );
if ( isset($_REQUEST['s']) && $_REQUEST['s'] ) if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() ); ?> printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() ); ?>
</h2> </h2>

View File

@ -56,10 +56,7 @@ $today = current_time('mysql', 1);
<div class="wrap"> <div class="wrap">
<?php screen_icon(); ?> <?php screen_icon(); ?>
<h2><?php <h2><?php echo esc_html( $title ); ?></h2>
echo esc_html( $title );
favorite_actions( $current_screen ); ?>
</h2>
<div id="dashboard-widgets-wrap"> <div id="dashboard-widgets-wrap">

View File

@ -59,9 +59,7 @@ if ( ! current_user_can('manage_links') )
<div class="wrap nosubsub"> <div class="wrap nosubsub">
<?php screen_icon(); ?> <?php screen_icon(); ?>
<h2><?php <h2><?php echo esc_html( $title ); ?> <a href="link-add.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'link'); ?></a> <?php
echo esc_html( $title );
favorite_actions( $current_screen );
if ( !empty($_REQUEST['s']) ) if ( !empty($_REQUEST['s']) )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( stripslashes($_REQUEST['s']) ) ); ?> printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( stripslashes($_REQUEST['s']) ) ); ?>
</h2> </h2>

View File

@ -99,13 +99,13 @@ require_once( '../admin-header.php' );
<div class="wrap"> <div class="wrap">
<?php screen_icon('ms-admin'); ?> <?php screen_icon('ms-admin'); ?>
<h2><?php <h2><?php _e('Sites') ?>
_e('Sites'); <?php echo $msg; ?>
echo $msg; <?php if ( current_user_can( 'create_sites') ) : ?>
if ( current_user_can( 'create_sites') ) { <a href="<?php echo network_admin_url('site-new.php'); ?>" class="button add-new-h2"><?php echo esc_html_x( 'Add New', 'site' ); ?></a>
favorite_actions( $current_screen ); <?php endif; ?>
}
if ( isset( $_REQUEST['s'] ) && $_REQUEST['s'] ) { <?php if ( isset( $_REQUEST['s'] ) && $_REQUEST['s'] ) {
printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $s ) ); printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $s ) );
} ?> } ?>
</h2> </h2>

View File

@ -199,11 +199,7 @@ require_once(ABSPATH . 'wp-admin/admin-header.php');
<div class="wrap"> <div class="wrap">
<?php screen_icon('themes'); ?> <?php screen_icon('themes'); ?>
<h2><?php <h2><?php echo esc_html( $title ); if ( current_user_can('install_themes') ) { ?> <a href="theme-install.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'theme'); ?></a><?php }
echo esc_html( $title );
if ( current_user_can('install_themes') ) {
favorite_actions( $current_screen );
}
if ( $s ) if ( $s )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $s ) ); ?> printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $s ) ); ?>
</h2> </h2>

View File

@ -72,14 +72,13 @@ if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty(
?> ?>
<div class="wrap"> <div class="wrap">
<?php screen_icon(); ?> <?php screen_icon(); ?>
<h2><?php <h2><?php esc_html_e( 'Users' );
esc_html_e( 'Users' ); if ( current_user_can( 'create_users') ) : ?>
if ( current_user_can( 'create_users' ) ) { <a href="<?php echo network_admin_url('user-new.php'); ?>" class="button add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a><?php
favorite_actions( $current_screen ); endif;
}
if ( !empty( $usersearch ) ) { if ( !empty( $usersearch ) )
printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) ); printf( '<span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', esc_html( $usersearch ) );
}
?> ?>
</h2> </h2>

View File

@ -385,11 +385,10 @@ if ( !empty($invalid) )
<div class="wrap"> <div class="wrap">
<?php screen_icon(); ?> <?php screen_icon(); ?>
<h2><?php <h2><?php echo esc_html( $title );
echo esc_html( $title ); if ( ( ! is_multisite() || is_network_admin() ) && current_user_can('install_plugins') ) { ?>
if ( ( ! is_multisite() || is_network_admin() ) && current_user_can('install_plugins') ) { <a href="<?php echo self_admin_url( 'plugin-install.php' ); ?>" class="button add-new-h2"><?php echo esc_html_x('Add New', 'plugin'); ?></a>
favorite_actions( $current_screen ); <?php }
}
if ( $s ) if ( $s )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $s ) ); ?> printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $s ) ); ?>
</h2> </h2>

View File

@ -71,16 +71,15 @@ require_once('./admin-header.php');
<div class="wrap"><?php <div class="wrap"><?php
screen_icon(); screen_icon();
if ( !is_multisite() ) : ?> if ( !is_multisite() ) : ?>
<h2 class="nav-tab-wrapper"> <h2 class="nav-tab-wrapper">
<a href="themes.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a><?php <a href="themes.php" class="nav-tab nav-tab-active"><?php echo esc_html( $title ); ?></a>
if ( current_user_can('install_themes') ) : <?php if ( current_user_can('install_themes') ) : ?>
?><a href="<?php echo admin_url( 'theme-install.php'); ?>" class="nav-tab"><?php echo esc_html_x('Install Themes', 'theme'); ?></a><?php <a href="<?php echo admin_url( 'theme-install.php'); ?>" class="nav-tab"><?php echo esc_html_x('Install Themes', 'theme'); ?></a>
endif; <?php endif;
else : ?> else : ?>
<h2> <h2>
<?php echo esc_html( $title ); ?> <?php echo esc_html( $title ); ?>
<?php endif; ?> <?php endif; ?>
</h2> </h2>

View File

@ -160,9 +160,7 @@ require_once('./admin-header.php');
<div class="wrap"> <div class="wrap">
<?php screen_icon(); ?> <?php screen_icon(); ?>
<h2><?php <h2><?php echo esc_html( $title ); ?> <a href="media-new.php" class="button add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a> <?php
echo esc_html( $title );
favorite_actions( $current_screen );
if ( isset($_REQUEST['s']) && $_REQUEST['s'] ) if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() ); ?> printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() ); ?>
</h2> </h2>

View File

@ -359,7 +359,12 @@ if ( ! empty($messages) ) {
<h2> <h2>
<?php <?php
echo esc_html( $title ); echo esc_html( $title );
favorite_actions( $current_screen ); if ( current_user_can( 'create_users' ) ) { ?>
<a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
<?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
<a href="user-new.php" class="button add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
<?php }
if ( $usersearch ) if ( $usersearch )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $usersearch ) ); ?> printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $usersearch ) ); ?>
</h2> </h2>