Make WordPress Core

Changeset 33067


Ignore:
Timestamp:
07/03/2015 04:41:18 PM (8 years ago)
Author:
obenland
Message:

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.

Location:
trunk/src
Files:
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/colors/_admin.scss

    r32075 r33067  
    8484/* List tables */
    8585
    86 .wrap .add-new-h2:hover,
     86.wrap .add-new-h2:hover, /* deprecated */
     87.wrap .page-title-action:hover,
    8788#add-new-comment a:hover,
    8889.tablenav .tablenav-pages a:hover,
  • trunk/src/wp-admin/css/common.css

    r33040 r33067  
    596596}
    597597
    598 .wrap .add-new-h2,
    599 .wrap .add-new-h2:active {
     598.wrap .add-new-h2, /* deprecated */
     599.wrap .add-new-h2:active, /* deprecated */
     600.wrap .page-title-action,
     601.wrap .page-title-action:active {
    600602    margin-left: 4px;
    601603    padding: 4px 8px;
     
    612614}
    613615
    614 .wrap .add-new-h2:hover {
     616.wrap .add-new-h2:hover, /* deprecated */
     617.wrap .page-title-action:hover {
    615618    background: #00a0d2;
    616619    color: #fff;
     
    31673170    }
    31683171
    3169     .wrap .add-new-h2, .wrap .add-new-h2:active {
     3172    .wrap .add-new-h2, /* deprecated */
     3173    .wrap .add-new-h2:active, /* deprecated */
     3174    .wrap .page-title-action,
     3175    .wrap .page-title-action:active {
    31703176        padding: 10px 15px;
    31713177        font-size: 14px;
  • trunk/src/wp-admin/edit-form-advanced.php

    r32974 r33067  
    418418echo esc_html( $title );
    419419if ( isset( $post_new_file ) && current_user_can( $post_type_object->cap->create_posts ) )
    420     echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
     420    echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
    421421?></h1>
    422422<?php if ( $notice ) : ?>
  • trunk/src/wp-admin/edit-link-form.php

    r32974 r33067  
    7171
    7272<div class="wrap">
    73 <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>
     73<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>
    7474
    7575<?php if ( isset( $_GET['added'] ) ) : ?>
  • trunk/src/wp-admin/edit.php

    r32974 r33067  
    287287echo esc_html( $post_type_object->labels->name );
    288288if ( current_user_can( $post_type_object->cap->create_posts ) )
    289     echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="add-new-h2">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
     289    echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
    290290if ( ! empty( $_REQUEST['s'] ) )
    291291    printf( ' <span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() );
  • trunk/src/wp-admin/link-manager.php

    r32974 r33067  
    7070
    7171<div class="wrap nosubsub">
    72 <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
     72<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
    7373if ( !empty($_REQUEST['s']) )
    7474    printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( wp_unslash($_REQUEST['s']) ) ); ?>
  • trunk/src/wp-admin/media.php

    r32974 r33067  
    108108echo esc_html( $title );
    109109if ( current_user_can( 'upload_files' ) ) { ?>
    110     <a href="media-new.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a>
     110    <a href="media-new.php" class="page-title-action"><?php echo esc_html_x('Add New', 'file'); ?></a>
    111111<?php } ?>
    112112</h1>
  • trunk/src/wp-admin/nav-menus.php

    r33004 r33067  
    567567            if ( current_user_can( 'customize' ) ) {
    568568                printf(
    569                     ' <a class="add-new-h2 hide-if-no-customize" href="%1$s">%2$s</a>',
     569                    ' <a class="page-title-action hide-if-no-customize" href="%1$s">%2$s</a>',
    570570                    esc_url( add_query_arg(
    571571                        array(
  • trunk/src/wp-admin/network/sites.php

    r32974 r33067  
    252252
    253253<?php if ( current_user_can( 'create_sites') ) : ?>
    254     <a href="<?php echo network_admin_url('site-new.php'); ?>" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'site' ); ?></a>
     254    <a href="<?php echo network_admin_url('site-new.php'); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'site' ); ?></a>
    255255<?php endif; ?>
    256256
  • trunk/src/wp-admin/network/themes.php

    r32974 r33067  
    262262
    263263<div class="wrap">
    264 <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 }
     264<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 }
    265265if ( $s )
    266266    printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( $s ) ); ?>
  • trunk/src/wp-admin/network/users.php

    r32974 r33067  
    312312    <h1><?php esc_html_e( 'Users' );
    313313    if ( current_user_can( 'create_users') ) : ?>
    314         <a href="<?php echo network_admin_url('user-new.php'); ?>" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a><?php
     314        <a href="<?php echo network_admin_url('user-new.php'); ?>" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a><?php
    315315    endif;
    316316
  • trunk/src/wp-admin/plugin-install.php

    r32974 r33067  
    106106            $text = __( 'Upload Plugin' );
    107107        }
    108         echo ' <a href="' . $href . '" class="upload add-new-h2">' . $text . '</a>';
     108        echo ' <a href="' . $href . '" class="upload page-title-action">' . $text . '</a>';
    109109    }
    110110    ?>
  • trunk/src/wp-admin/plugins.php

    r32974 r33067  
    449449<h1><?php echo esc_html( $title );
    450450if ( ( ! is_multisite() || is_network_admin() ) && current_user_can('install_plugins') ) { ?>
    451  <a href="<?php echo self_admin_url( 'plugin-install.php' ); ?>" class="add-new-h2"><?php echo esc_html_x('Add New', 'plugin'); ?></a>
     451 <a href="<?php echo self_admin_url( 'plugin-install.php' ); ?>" class="page-title-action"><?php echo esc_html_x('Add New', 'plugin'); ?></a>
    452452<?php }
    453453if ( $s )
  • trunk/src/wp-admin/theme-install.php

    r32974 r33067  
    118118    $tabs = apply_filters( 'install_themes_tabs', array( 'upload' => __( 'Upload Theme' ) ) );
    119119    if ( ! empty( $tabs['upload'] ) && current_user_can( 'upload_themes' ) ) {
    120         echo ' <a href="#" class="upload add-new-h2">' . __( 'Upload Theme' ) . '</a>';
    121         echo ' <a href="#" class="browse-themes add-new-h2">' . _x( 'Browse', 'themes' ) . '</a>';
     120        echo ' <a href="#" class="upload page-title-action">' . __( 'Upload Theme' ) . '</a>';
     121        echo ' <a href="#" class="browse-themes page-title-action">' . _x( 'Browse', 'themes' ) . '</a>';
    122122    }
    123123    ?></h1>
  • trunk/src/wp-admin/themes.php

    r32974 r33067  
    128128        <span class="title-count theme-count"><?php echo count( $themes ); ?></span>
    129129    <?php if ( ! is_multisite() && current_user_can( 'install_themes' ) ) : ?>
    130         <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>
     130        <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>
    131131    <?php endif; ?>
    132132    </h1>
  • trunk/src/wp-admin/upload.php

    r32974 r33067  
    7676        echo esc_html( $title );
    7777        if ( current_user_can( 'upload_files' ) ) { ?>
    78             <a href="media-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'file' ); ?></a><?php
     78            <a href="media-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'file' ); ?></a><?php
    7979        }
    8080        ?>
     
    211211echo esc_html( $title );
    212212if ( current_user_can( 'upload_files' ) ) { ?>
    213     <a href="media-new.php" class="add-new-h2"><?php echo esc_html_x('Add New', 'file'); ?></a><?php
     213    <a href="media-new.php" class="page-title-action"><?php echo esc_html_x('Add New', 'file'); ?></a><?php
    214214}
    215215if ( ! empty( $_REQUEST['s'] ) )
  • trunk/src/wp-admin/user-edit.php

    r33023 r33067  
    208208if ( ! IS_PROFILE_PAGE ) {
    209209    if ( current_user_can( 'create_users' ) ) { ?>
    210         <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
     210        <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
    211211    <?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
    212         <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
     212        <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
    213213    <?php }
    214214} ?>
  • trunk/src/wp-admin/users.php

    r32974 r33067  
    448448echo esc_html( $title );
    449449if ( current_user_can( 'create_users' ) ) { ?>
    450     <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
     450    <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add New', 'user' ); ?></a>
    451451<?php } elseif ( is_multisite() && current_user_can( 'promote_users' ) ) { ?>
    452     <a href="user-new.php" class="add-new-h2"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
     452    <a href="user-new.php" class="page-title-action"><?php echo esc_html_x( 'Add Existing', 'user' ); ?></a>
    453453<?php }
    454454
  • trunk/src/wp-admin/widgets.php

    r32974 r33067  
    321321    if ( current_user_can( 'customize' ) ) {
    322322        printf(
    323             ' <a class="add-new-h2 hide-if-no-customize" href="%1$s">%2$s</a>',
     323            ' <a class="page-title-action hide-if-no-customize" href="%1$s">%2$s</a>',
    324324            esc_url( add_query_arg(
    325325                array(
  • trunk/src/wp-includes/js/media-grid.js

    r32862 r33067  
    664664        this.$adminBar = $( '#wpadminbar' );
    665665        this.$window.on( 'scroll resize', _.debounce( _.bind( this.fixPosition, this ), 15 ) );
    666         $( document ).on( 'click', '.add-new-h2', _.bind( this.addNewClickHandler, this ) );
     666        $( document ).on( 'click', '.page-title-action', _.bind( this.addNewClickHandler, this ) );
    667667
    668668        // Ensure core and media grid view UI is enabled.
  • trunk/src/wp-includes/js/media/views/frame/manage.js

    r32466 r33067  
    4242        this.$adminBar = $( '#wpadminbar' );
    4343        this.$window.on( 'scroll resize', _.debounce( _.bind( this.fixPosition, this ), 15 ) );
    44         $( document ).on( 'click', '.add-new-h2', _.bind( this.addNewClickHandler, this ) );
     44        $( document ).on( 'click', '.page-title-action', _.bind( this.addNewClickHandler, this ) );
    4545
    4646        // Ensure core and media grid view UI is enabled.
Note: See TracChangeset for help on using the changeset viewer.