WordPress.org

Make WordPress Core

Ticket #17324: h2-to-h1.diff

File h2-to-h1.diff, 6.1 KB (added by ryan, 7 years ago)
  • wp-admin/includes/template.php

     
    21412141}
    21422142
    21432143/**
     2144 * Set an attribute for the current screen object
     2145 *
     2146 * @since 3.2.0
     2147 *
     2148 * @param string $key An attribute name
     2149 * @param mixed $value Attribute value
     2150 */
     2151function set_screen_attribute( $key, $value ) {
     2152        global $current_screen;
     2153
     2154        $current_screen->$key = $value;
     2155}
     2156
     2157/**
    21442158 * Echos a submit button, with provided text and appropriate class
    21452159 *
    21462160 * @since 3.1.0
  • wp-admin/edit-tags.php

     
    221221        unset($help);
    222222}
    223223
     224set_screen_attribute( 'title', $title );
     225
     226if ( !empty($_REQUEST['s']) )
     227        set_screen_attribute( 'sub_title', sprintf( __( 'Search results for “%s”' ), esc_html( stripslashes($_REQUEST['s']) ) ) );
     228
    224229require_once ('admin-header.php');
    225230
    226231if ( !current_user_can($tax->cap->edit_terms) )
     
    236241?>
    237242
    238243<div class="wrap nosubsub">
    239 <?php screen_icon(); ?>
    240 <h2><?php echo esc_html( $title );
    241 if ( !empty($_REQUEST['s']) )
    242         printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', esc_html( stripslashes($_REQUEST['s']) ) ); ?>
    243 </h2>
    244244
    245245<?php if ( isset($_REQUEST['message']) && ( $msg = (int) $_REQUEST['message'] ) ) : ?>
    246246<div id="message" class="updated"><p><?php echo $messages[$msg]; ?></p></div>
  • wp-admin/options-general.php

     
    7474?>
    7575
    7676<div class="wrap">
    77 <?php screen_icon(); ?>
    78 <h2><?php echo esc_html( $title ); ?></h2>
    7977
    8078<form method="post" action="options.php">
    8179<?php settings_fields('general'); ?>
  • wp-admin/index.php

     
    5555?>
    5656
    5757<div class="wrap">
    58 <?php screen_icon(); ?>
    59 <h2><?php
    60 echo esc_html( $title );
    61 favorite_actions( $current_screen ); ?>
    62 </h2>
    6358
    6459<div id="dashboard-widgets-wrap">
    6560
  • wp-admin/edit-form-advanced.php

     
    194194?>
    195195
    196196<div class="wrap">
    197 <?php screen_icon(); ?>
    198 <h2><?php echo esc_html( $title ); ?></h2>
    199197<?php if ( $notice ) : ?>
    200198<div id="notice" class="error"><p><?php echo $notice ?></p></div>
    201199<?php endif; ?>
  • wp-admin/admin-header.php

     
    1010if ( ! defined( 'WP_ADMIN' ) )
    1111        require_once( './admin.php' );
    1212
     13$current_screen->parent_file = $parent_file;
     14$current_screen->parent_base = preg_replace('/\?.*$/', '', $parent_file);
     15$current_screen->parent_base = str_replace('.php', '', $current_screen->parent_base);
     16
    1317get_admin_page_title();
    1418$title = esc_html( strip_tags( $title ) );
    1519
     
    129133        if ( strlen($blog_name) > 30 )
    130134                $title_class = 'class="long-title"';
    131135}
     136
     137$screen_icon = !empty( $current_screen->icon ) ? sanitize_key( $current_screen->icon ) : '';
     138screen_icon();
     139
     140if ( !empty( $current_screen->title ) )
     141        $title = esc_html( strip_tags( $current_screen->title ) );
    132142?>
    133 
    134 <img id="header-logo" src="<?php echo esc_url( includes_url( 'images/blank.gif' ) ); ?>" alt="" width="16" height="16" />
    135143<h1 id="site-heading" <?php echo $title_class ?>>
    136         <a href="<?php echo trailingslashit( get_bloginfo( 'url' ) ); ?>" title="<?php esc_attr_e('Visit Site') ?>">
    137                 <span id="site-title"><?php echo $blog_name ?></span>
    138         </a>
     144        <?php echo $title;
     145        if ( ! empty( $current_screen->sub_title ) )
     146                echo '<span class="subtitle">' . esc_html( strip_tags( $current_screen->sub_title ) ) . '</span>';
     147        ?>
    139148</h1>
    140149
    141150<?php
     
    161170$links = array_map( 'trim', $links, array_fill( 0, count( $links ), " |\n\t" ) );
    162171$links = '<li>' . implode( '</li><li>', $links ) . '</li>';
    163172
     173// Site greeting
     174$welcome = home_url();
     175$welcome = preg_replace( '#^https?://#', '', $welcome );
     176untrailingslashit( $welcome );
     177
     178$welcome = sprintf( __( 'Welcome to %s' ), '<a href="'. get_home_url() . '">' . esc_html( $welcome ) . '</a>' );
    164179?>
    165180
    166181<div id="wphead-info">
     
    171186                <ul><?php echo $links; ?></ul>
    172187        </div></div>
    173188</div>
     189<p><?php echo $welcome; ?></p>
    174190</div>
    175191</div>
    176192
     
    178194
    179195<div id="wpbody">
    180196<?php
    181 unset($title_class, $blog_name, $total_update_count, $update_title);
     197unset($title_class, $blog_name, $total_update_count, $update_title, $howdy, $welcome);
    182198
    183 $current_screen->parent_file = $parent_file;
    184 $current_screen->parent_base = preg_replace('/\?.*$/', '', $parent_file);
    185 $current_screen->parent_base = str_replace('.php', '', $current_screen->parent_base);
    186199?>
    187200
    188201<div id="wpbody-content">
  • wp-admin/edit.php

     
    186186
    187187add_screen_option( 'per_page', array('label' => $title, 'default' => 20) );
    188188
     189set_screen_attribute( 'title', $title );
     190
     191if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
     192        set_screen_attribute( 'sub_title', sprintf( __( 'Search results for &#8220;%s&#8221;' ), get_search_query() ) );
     193
    189194require_once('./admin-header.php');
    190195?>
    191196<div class="wrap">
    192 <?php screen_icon(); ?>
    193 <h2><?php
    194 echo esc_html( $post_type_object->labels->name );
    195 favorite_actions( $current_screen );
    196 if ( isset($_REQUEST['s']) && $_REQUEST['s'] )
    197         printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() ); ?>
    198 </h2>
    199197
    200198<?php
    201199if ( isset($_REQUEST['posted']) && $_REQUEST['posted'] ) : $_REQUEST['posted'] = (int) $_REQUEST['posted']; ?>