Use a less element-specific class name for links within page titles.

After [32974] these links are no longer within an `h2`, making the class name
inaccurate. `add-new-h1` has the potential to expose the same problem for in a
possible future change.

Fixes #31650.


Built from https://develop.svn.wordpress.org/trunk@33067


git-svn-id: http://core.svn.wordpress.org/trunk@33038 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Konstantin Obenland 2015-07-03 16:42:24 +00:00
parent 2f383536fc
commit bd974d7bf2
53 changed files with 78 additions and 65 deletions

View File

@ -83,7 +83,8 @@ input[type=radio]:checked:before {
/* List tables */
.wrap .add-new-h2:hover,
.wrap .add-new-h2:hover, /* deprecated */
.wrap .page-title-action:hover,
#add-new-comment a:hover,
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {

View File

@ -111,7 +111,7 @@ input[type=radio]:checked:before {
}
/* List tables */
.wrap .add-new-h2:hover,
.wrap .add-new-h2:hover, .wrap .page-title-action:hover,
#add-new-comment a:hover,
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {

File diff suppressed because one or more lines are too long

View File

@ -111,7 +111,7 @@ input[type=radio]:checked:before {
}
/* List tables */
.wrap .add-new-h2:hover,
.wrap .add-new-h2:hover, .wrap .page-title-action:hover,
#add-new-comment a:hover,
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {

File diff suppressed because one or more lines are too long

View File

@ -111,7 +111,7 @@ input[type=radio]:checked:before {
}
/* List tables */
.wrap .add-new-h2:hover,
.wrap .add-new-h2:hover, .wrap .page-title-action:hover,
#add-new-comment a:hover,
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {

File diff suppressed because one or more lines are too long

View File

@ -111,7 +111,7 @@ input[type=radio]:checked:before {
}
/* List tables */
.wrap .add-new-h2:hover,
.wrap .add-new-h2:hover, .wrap .page-title-action:hover,
#add-new-comment a:hover,
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {

File diff suppressed because one or more lines are too long

View File

@ -111,7 +111,7 @@ input[type=radio]:checked:before {
}
/* List tables */
.wrap .add-new-h2:hover,
.wrap .add-new-h2:hover, .wrap .page-title-action:hover,
#add-new-comment a:hover,
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {

File diff suppressed because one or more lines are too long

View File

@ -111,7 +111,7 @@ input[type=radio]:checked:before {
}
/* List tables */
.wrap .add-new-h2:hover,
.wrap .add-new-h2:hover, .wrap .page-title-action:hover,
#add-new-comment a:hover,
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {

File diff suppressed because one or more lines are too long

View File

@ -111,7 +111,7 @@ input[type=radio]:checked:before {
}
/* List tables */
.wrap .add-new-h2:hover,
.wrap .add-new-h2:hover, .wrap .page-title-action:hover,
#add-new-comment a:hover,
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {

File diff suppressed because one or more lines are too long

View File

@ -111,7 +111,7 @@ input[type=radio]:checked:before {
}
/* List tables */
.wrap .add-new-h2:hover,
.wrap .add-new-h2:hover, .wrap .page-title-action:hover,
#add-new-comment a:hover,
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {

File diff suppressed because one or more lines are too long

View File

@ -111,7 +111,7 @@ input[type=radio]:checked:before {
}
/* List tables */
.wrap .add-new-h2:hover,
.wrap .add-new-h2:hover, .wrap .page-title-action:hover,
#add-new-comment a:hover,
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {

File diff suppressed because one or more lines are too long

View File

@ -111,7 +111,7 @@ input[type=radio]:checked:before {
}
/* List tables */
.wrap .add-new-h2:hover,
.wrap .add-new-h2:hover, .wrap .page-title-action:hover,
#add-new-comment a:hover,
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {

File diff suppressed because one or more lines are too long

View File

@ -111,7 +111,7 @@ input[type=radio]:checked:before {
}
/* List tables */
.wrap .add-new-h2:hover,
.wrap .add-new-h2:hover, .wrap .page-title-action:hover,
#add-new-comment a:hover,
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {

File diff suppressed because one or more lines are too long

View File

@ -111,7 +111,7 @@ input[type=radio]:checked:before {
}
/* List tables */
.wrap .add-new-h2:hover,
.wrap .add-new-h2:hover, .wrap .page-title-action:hover,
#add-new-comment a:hover,
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {

File diff suppressed because one or more lines are too long

View File

@ -111,7 +111,7 @@ input[type=radio]:checked:before {
}
/* List tables */
.wrap .add-new-h2:hover,
.wrap .add-new-h2:hover, .wrap .page-title-action:hover,
#add-new-comment a:hover,
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {

File diff suppressed because one or more lines are too long

View File

@ -111,7 +111,7 @@ input[type=radio]:checked:before {
}
/* List tables */
.wrap .add-new-h2:hover,
.wrap .add-new-h2:hover, .wrap .page-title-action:hover,
#add-new-comment a:hover,
.tablenav .tablenav-pages a:hover,
.tablenav .tablenav-pages a:focus {

File diff suppressed because one or more lines are too long

View File

@ -595,8 +595,10 @@ code {
padding-right: 25px;
}
.wrap .add-new-h2,
.wrap .add-new-h2:active {
.wrap .add-new-h2, /* deprecated */
.wrap .add-new-h2:active, /* deprecated */
.wrap .page-title-action,
.wrap .page-title-action:active {
margin-right: 4px;
padding: 4px 8px;
position: relative;
@ -611,7 +613,8 @@ code {
font-size: 13px;
}
.wrap .add-new-h2:hover {
.wrap .add-new-h2:hover, /* deprecated */
.wrap .page-title-action:hover {
background: #00a0d2;
color: #fff;
}
@ -3166,7 +3169,10 @@ img {
display: none !important;
}
.wrap .add-new-h2, .wrap .add-new-h2:active {
.wrap .add-new-h2, /* deprecated */
.wrap .add-new-h2:active, /* deprecated */
.wrap .page-title-action,
.wrap .page-title-action:active {
padding: 10px 15px;
font-size: 14px;
white-space: nowrap;

View File

@ -595,8 +595,10 @@ code {
padding-left: 25px;
}
.wrap .add-new-h2,
.wrap .add-new-h2:active {
.wrap .add-new-h2, /* deprecated */
.wrap .add-new-h2:active, /* deprecated */
.wrap .page-title-action,
.wrap .page-title-action:active {
margin-left: 4px;
padding: 4px 8px;
position: relative;
@ -611,7 +613,8 @@ code {
font-size: 13px;
}
.wrap .add-new-h2:hover {
.wrap .add-new-h2:hover, /* deprecated */
.wrap .page-title-action:hover {
background: #00a0d2;
color: #fff;
}
@ -3166,7 +3169,10 @@ img {
display: none !important;
}
.wrap .add-new-h2, .wrap .add-new-h2:active {
.wrap .add-new-h2, /* deprecated */
.wrap .add-new-h2:active, /* deprecated */
.wrap .page-title-action,
.wrap .page-title-action:active {
padding: 10px 15px;
font-size: 14px;
white-space: nowrap;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -417,7 +417,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<h1><?php
echo esc_html( $title );
if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) )
echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
?></h1>
<?php if ( $notice ) : ?>
<div id="notice" class="notice notice-warning"><p id="has-newer-autosave"><?php echo $notice ?></p></div>

View File

@ -70,7 +70,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
?>
<div class="wrap">
<h1><?php echo esc_html( $title ); ?> <a href="link-add.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'link'); ?></a></h1>
<h1><?php echo esc_html( $title ); ?> <a href="link-add.php" class="page-title-action"><?php echo esc_html_x('Add New', 'link'); ?></a></h1>
<?php if ( isset( $_GET['added'] ) ) : ?>
<div id="message" class="updated notice is-dismissible"><p><?php _e('Link added.'); ?></p></div>

View File

@ -286,7 +286,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<h1><?php
echo esc_html( $post_type_object->labels->name );
if ( current_user_can( $post_type_object->cap->create_posts ) )
echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
if ( ! empty( $_REQUEST['s'] ) )
printf( ' <span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() );
?></h1>

View File

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

View File

@ -107,7 +107,7 @@ case 'edit' :
<?php
echo esc_html( $title );
if ( current_user_can( 'upload_files' ) ) { ?>
<a href="media-new.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a>
<a href="media-new.php" class="page-title-action"><?php echo esc_html_x('Add New', 'file'); ?></a>
<?php } ?>
</h1>

View File

@ -566,7 +566,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<?php
if ( current_user_can( 'customize' ) ) {
printf(
' <a class="add-new-h2 hide-if-no-customize" href="%1$s">%2$s</a>',
' <a class="page-title-action hide-if-no-customize" href="%1$s">%2$s</a>',
esc_url( add_query_arg(
array(
array( 'autofocus' => array( 'panel' => 'nav_menus' ) ),

View File

@ -251,7 +251,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<h1><?php _e( 'Sites' ); ?>
<?php if ( current_user_can( 'create_sites') ) : ?>
<a href="<?php echo network_admin_url('site-new.php'); ?>" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'site' ); ?></a>
<a href="<?php echo network_admin_url('site-new.php'); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'site' ); ?></a>
<?php endif; ?>
<?php if ( isset( $_REQUEST['s'] ) && $_REQUEST['s'] ) {

View File

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

View File

@ -311,7 +311,7 @@ if ( isset( $_REQUEST['updated'] ) && $_REQUEST['updated'] == 'true' && ! empty(
<div class="wrap">
<h1><?php esc_html_e( 'Users' );
if ( current_user_can( 'create_users') ) : ?>
<a href="<?php echo network_admin_url('user-new.php'); ?>" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a><?php
<a href="<?php echo network_admin_url('user-new.php'); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a><?php
endif;
if ( !empty( $usersearch ) )

View File

@ -105,7 +105,7 @@ include(ABSPATH . 'wp-admin/admin-header.php');
$href = self_admin_url( 'plugin-install.php?tab=upload' );
$text = __( 'Upload Plugin' );
}
echo ' <a href="' . $href . '" class="upload add-new-h2">' . $text . '</a>';
echo ' <a href="' . $href . '" class="upload page-title-action">' . $text . '</a>';
}
?>
</h1>

View File

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

View File

@ -117,8 +117,8 @@ include(ABSPATH . 'wp-admin/admin-header.php');
*/
$tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) );
if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_themes' ) ) {
echo ' <a href="#" class="upload add-new-h2">' . __( 'Upload Theme' ) . '</a>';
echo ' <a href="#" class="browse-themes add-new-h2">' . _x( 'Browse', 'themes' ) . '</a>';
echo ' <a href="#" class="upload page-title-action">' . __( 'Upload Theme' ) . '</a>';
echo ' <a href="#" class="browse-themes page-title-action">' . _x( 'Browse', 'themes' ) . '</a>';
}
?></h1>

View File

@ -127,7 +127,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<h1><?php esc_html_e( 'Themes' ); ?>
<span class="title-count theme-count"><?php echo count( $themes ); ?></span>
<?php if ( ! is_multisite() && current_user_can( 'install_themes' ) ) : ?>
<a href="<?php echo admin_url( 'theme-install.php' ); ?>" class="hide-if-no-js add-new-h2"><?php echo esc_html_x( 'Add New', 'Add new theme' ); ?></a>
<a href="<?php echo admin_url( 'theme-install.php' ); ?>" class="hide-if-no-js page-title-action"><?php echo esc_html_x( 'Add New', 'Add new theme' ); ?></a>
<?php endif; ?>
</h1>
<?php

View File

@ -75,7 +75,7 @@ if ( 'grid' === $mode ) {
<?php
echo esc_html( $title );
if ( current_user_can( 'upload_files' ) ) { ?>
<a href="media-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'file' ); ?></a><?php
<a href="media-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'file' ); ?></a><?php
}
?>
</h1>
@ -210,7 +210,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<?php
echo esc_html( $title );
if ( current_user_can( 'upload_files' ) ) { ?>
<a href="media-new.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a><?php
<a href="media-new.php" class="page-title-action"><?php echo esc_html_x('Add New', 'file'); ?></a><?php
}
if ( ! empty( $_REQUEST['s'] ) )
printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() ); ?>

View File

@ -207,9 +207,9 @@ include(ABSPATH . 'wp-admin/admin-header.php');
echo esc_html( $title );
if ( ! IS_PROFILE_PAGE ) {
if ( current_user_can( 'create_users' ) ) { ?>
<a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
<a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
<?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
<a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
<a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
<?php }
} ?>
</h1>

View File

@ -447,9 +447,9 @@ if ( ! empty($messages) ) {
<?php
echo esc_html( $title );
if ( current_user_can( 'create_users' ) ) { ?>
<a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
<a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
<?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
<a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
<a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
<?php }
if ( $usersearch )

View File

@ -320,7 +320,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
echo esc_html( $title );
if ( current_user_can( 'customize' ) ) {
printf(
' <a class="add-new-h2 hide-if-no-customize" href="%1$s">%2$s</a>',
' <a class="page-title-action hide-if-no-customize" href="%1$s">%2$s</a>',
esc_url( add_query_arg(
array(
array( 'autofocus' => array( 'panel' => 'widgets' ) ),

View File

@ -663,7 +663,7 @@ Manage = MediaFrame.extend({
this.$window = $( window );
this.$adminBar = $( '#wpadminbar' );
this.$window.on( 'scroll resize', _.debounce( _.bind( this.fixPosition, this ), 15 ) );
$( document ).on( 'click', '.add-new-h2', _.bind( this.addNewClickHandler, this ) );
$( document ).on( 'click', '.page-title-action', _.bind( this.addNewClickHandler, this ) );
// Ensure core and media grid view UI is enabled.
this.$el.addClass('wp-core-ui');

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.3-beta1-33066';
$wp_version = '4.3-beta1-33067';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.