From e59592f87e062c74857a741ef0aa08e409b1abda Mon Sep 17 00:00:00 2001 From: Konstantin Obenland Date: Sat, 27 Jun 2015 15:40:27 +0000 Subject: [PATCH] Proper heading for admin screens. First step towards restoring a good heading structure in wp-admin. The previous `

` contained the site title and a link to the front page and was removed with the toolbar refactoring in 3.2. Props joedolson, afercia. Fixes #31650. git-svn-id: https://develop.svn.wordpress.org/trunk@32974 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/comment.php | 2 +- src/wp-admin/css/common.css | 3 +++ src/wp-admin/custom-background.php | 2 +- src/wp-admin/custom-header.php | 4 ++-- src/wp-admin/edit-comments.php | 4 ++-- src/wp-admin/edit-form-advanced.php | 4 ++-- src/wp-admin/edit-form-comment.php | 2 +- src/wp-admin/edit-link-form.php | 2 +- src/wp-admin/edit-tag-form.php | 2 +- src/wp-admin/edit-tags.php | 4 ++-- src/wp-admin/edit.php | 4 ++-- src/wp-admin/export.php | 2 +- src/wp-admin/import.php | 2 +- src/wp-admin/includes/class-wp-upgrader-skins.php | 2 +- src/wp-admin/index.php | 2 +- src/wp-admin/js/common.js | 8 +++++++- src/wp-admin/js/theme.js | 2 +- src/wp-admin/link-manager.php | 4 ++-- src/wp-admin/media-new.php | 2 +- src/wp-admin/media.php | 4 ++-- src/wp-admin/ms-delete-site.php | 2 +- src/wp-admin/my-sites.php | 2 +- src/wp-admin/nav-menus.php | 4 ++-- src/wp-admin/network.php | 2 +- src/wp-admin/network/index.php | 2 +- src/wp-admin/network/settings.php | 2 +- src/wp-admin/network/site-info.php | 2 +- src/wp-admin/network/site-new.php | 2 +- src/wp-admin/network/site-settings.php | 2 +- src/wp-admin/network/site-themes.php | 2 +- src/wp-admin/network/site-users.php | 2 +- src/wp-admin/network/sites.php | 6 +++--- src/wp-admin/network/themes.php | 10 +++++----- src/wp-admin/network/upgrade.php | 2 +- src/wp-admin/network/user-new.php | 2 +- src/wp-admin/network/users.php | 6 +++--- src/wp-admin/options-discussion.php | 2 +- src/wp-admin/options-general.php | 2 +- src/wp-admin/options-media.php | 2 +- src/wp-admin/options-permalink.php | 2 +- src/wp-admin/options-reading.php | 2 +- src/wp-admin/options-writing.php | 2 +- src/wp-admin/options.php | 2 +- src/wp-admin/plugin-editor.php | 4 ++-- src/wp-admin/plugin-install.php | 4 ++-- src/wp-admin/plugins.php | 10 +++++----- src/wp-admin/revision.php | 4 ++-- src/wp-admin/theme-editor.php | 2 +- src/wp-admin/theme-install.php | 4 ++-- src/wp-admin/themes.php | 4 ++-- src/wp-admin/tools.php | 2 +- src/wp-admin/update-core.php | 8 ++++---- src/wp-admin/upload.php | 8 ++++---- src/wp-admin/user-edit.php | 4 ++-- src/wp-admin/user-new.php | 4 ++-- src/wp-admin/users.php | 8 ++++---- src/wp-admin/widgets.php | 6 +++--- 57 files changed, 103 insertions(+), 94 deletions(-) diff --git a/src/wp-admin/comment.php b/src/wp-admin/comment.php index 0630c07474..4c71f3422f 100644 --- a/src/wp-admin/comment.php +++ b/src/wp-admin/comment.php @@ -117,7 +117,7 @@ case 'spam' : ?>
-

+

h1, h2 { color: #23282d; font-size: 1.5em; @@ -564,12 +565,14 @@ code { color: #00a0d2; } +.wrap h1, .wrap h2, .subtitle { font-weight: normal; margin: 0; } +.wrap h1, .wrap h2 { font-size: 23px; font-weight: 400; diff --git a/src/wp-admin/custom-background.php b/src/wp-admin/custom-background.php index 61a700af5e..36a5b504fa 100644 --- a/src/wp-admin/custom-background.php +++ b/src/wp-admin/custom-background.php @@ -176,7 +176,7 @@ class Custom_Background { public function admin_page() { ?>
-

+

diff --git a/src/wp-admin/custom-header.php b/src/wp-admin/custom-header.php index 966d356639..4aeb8053c3 100644 --- a/src/wp-admin/custom-header.php +++ b/src/wp-admin/custom-header.php @@ -446,7 +446,7 @@ class Custom_Image_Header { ?>
-

+

@@ -754,7 +754,7 @@ wp_nonce_field( 'custom-header-options', '_wpnonce-custom-header-options' ); ?> ?>
-

+

diff --git a/src/wp-admin/edit-comments.php b/src/wp-admin/edit-comments.php index e7cd83585c..057b0a5d6c 100644 --- a/src/wp-admin/edit-comments.php +++ b/src/wp-admin/edit-comments.php @@ -140,7 +140,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

%s', @@ -153,7 +153,7 @@ else if ( isset($_REQUEST['s']) && $_REQUEST['s'] ) echo '' . sprintf( __( 'Search results for “%s”' ), wp_html_excerpt( esc_html( wp_unslash( $_REQUEST['s'] ) ), 50, '…' ) ) . ''; ?> -

+

-

cap->create_posts ) ) echo ' ' . esc_html( $post_type_object->labels->add_new ) . ''; -?>

+?>

diff --git a/src/wp-admin/edit-form-comment.php b/src/wp-admin/edit-form-comment.php index 2c91673b66..ce644c12ac 100644 --- a/src/wp-admin/edit-form-comment.php +++ b/src/wp-admin/edit-form-comment.php @@ -13,7 +13,7 @@ if ( !defined('ABSPATH') ) comment_ID) ?>
-

+

diff --git a/src/wp-admin/edit-link-form.php b/src/wp-admin/edit-link-form.php index f326689dad..fe0b94d22d 100644 --- a/src/wp-admin/edit-link-form.php +++ b/src/wp-admin/edit-link-form.php @@ -70,7 +70,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

+

diff --git a/src/wp-admin/edit-tag-form.php b/src/wp-admin/edit-tag-form.php index 7e2d937785..ac5aafbf8f 100644 --- a/src/wp-admin/edit-tag-form.php +++ b/src/wp-admin/edit-tag-form.php @@ -62,7 +62,7 @@ if ( 'category' == $taxonomy ) { do_action( "{$taxonomy}_pre_edit_form", $tag, $taxonomy ); ?>
-

labels->edit_item; ?>

+

labels->edit_item; ?>

-

' . __('Search results for “%s”') . '', esc_html( wp_unslash($_REQUEST['s']) ) ); ?> -

+

diff --git a/src/wp-admin/edit.php b/src/wp-admin/edit.php index cc3c8dc32c..e1dda8418c 100644 --- a/src/wp-admin/edit.php +++ b/src/wp-admin/edit.php @@ -283,13 +283,13 @@ $bulk_counts = array_filter( $bulk_counts ); require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

labels->name ); if ( current_user_can( $post_type_object->cap->create_posts ) ) echo ' ' . esc_html( $post_type_object->labels->add_new ) . ''; if ( ! empty( $_REQUEST['s'] ) ) printf( ' ' . __('Search results for “%s”') . '', get_search_query() ); -?>

+?>
-

+

diff --git a/src/wp-admin/import.php b/src/wp-admin/import.php index 0f427760b4..e7dce2df13 100644 --- a/src/wp-admin/import.php +++ b/src/wp-admin/import.php @@ -52,7 +52,7 @@ $parent_file = 'tools.php'; ?>
-

+

%s importer is invalid or is not installed.'), esc_html( $_GET['invalid'] ) ); ?>

diff --git a/src/wp-admin/includes/class-wp-upgrader-skins.php b/src/wp-admin/includes/class-wp-upgrader-skins.php index bb7325e420..b0cd3c15ad 100644 --- a/src/wp-admin/includes/class-wp-upgrader-skins.php +++ b/src/wp-admin/includes/class-wp-upgrader-skins.php @@ -84,7 +84,7 @@ class WP_Upgrader_Skin { } $this->done_header = true; echo '
'; - echo '

' . $this->options['title'] . '

'; + echo '

' . $this->options['title'] . '

'; } /** diff --git a/src/wp-admin/index.php b/src/wp-admin/index.php index 40c7c7f2a1..9143928984 100644 --- a/src/wp-admin/index.php +++ b/src/wp-admin/index.php @@ -93,7 +93,7 @@ include( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

+

h1:first' ); + + // Back compatibility: if there is no H1, apply to first H2. + if ( ! $firstHeading.length ) { + $firstHeading = $( '.wrap h2:first' ); + } + $firstHeading.nextAll( 'div.updated, div.error, div.notice' ).addClass( 'below-h2' ); $( 'div.updated, div.error, div.notice' ).not( '.below-h2, .inline' ).insertAfter( $firstHeading ); diff --git a/src/wp-admin/js/theme.js b/src/wp-admin/js/theme.js index 2cf5f770ad..c307636a37 100644 --- a/src/wp-admin/js/theme.js +++ b/src/wp-admin/js/theme.js @@ -84,7 +84,7 @@ themes.view.Appearance = wp.Backbone.View.extend({ }, // Defines search element container - searchContainer: $( '#wpbody h2:first' ), + searchContainer: $( '#wpbody h1:first' ), // Search input and view // for current theme collection diff --git a/src/wp-admin/link-manager.php b/src/wp-admin/link-manager.php index 9313f37508..7c26d5357d 100644 --- a/src/wp-admin/link-manager.php +++ b/src/wp-admin/link-manager.php @@ -69,10 +69,10 @@ if ( ! current_user_can('manage_links') ) ?>
-

' . __('Search results for “%s”') . '', esc_html( wp_unslash($_REQUEST['s']) ) ); ?> -

+
-

+

diff --git a/src/wp-admin/media.php b/src/wp-admin/media.php index 62b2401be4..76587cafdb 100644 --- a/src/wp-admin/media.php +++ b/src/wp-admin/media.php @@ -103,13 +103,13 @@ case 'edit' : ?>
-

+

-

+

diff --git a/src/wp-admin/ms-delete-site.php b/src/wp-admin/ms-delete-site.php index 07d87e2066..71ad38ffc4 100644 --- a/src/wp-admin/ms-delete-site.php +++ b/src/wp-admin/ms-delete-site.php @@ -32,7 +32,7 @@ $parent_file = 'tools.php'; require_once( ABSPATH . 'wp-admin/admin-header.php' ); echo '

'; -echo '

' . esc_html( $title ) . '

'; +echo '

' . esc_html( $title ) . '

'; if ( isset( $_POST['action'] ) && $_POST['action'] == 'deleteblog' && isset( $_POST['confirmdelete'] ) && $_POST['confirmdelete'] == '1' ) { check_admin_referer( 'delete-blog' ); diff --git a/src/wp-admin/my-sites.php b/src/wp-admin/my-sites.php index 269b081166..011634fa7b 100644 --- a/src/wp-admin/my-sites.php +++ b/src/wp-admin/my-sites.php @@ -56,7 +56,7 @@ if ( $updated ) { ?>
-

+

'; diff --git a/src/wp-admin/nav-menus.php b/src/wp-admin/nav-menus.php index bc2d374a27..8a3511b359 100644 --- a/src/wp-admin/nav-menus.php +++ b/src/wp-admin/nav-menus.php @@ -558,12 +558,12 @@ get_current_screen()->set_help_sidebar( require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

-

+ set_help_sidebar( include( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

+

-

+

diff --git a/src/wp-admin/network/settings.php b/src/wp-admin/network/settings.php index f3ef480056..1872eb81c0 100644 --- a/src/wp-admin/network/settings.php +++ b/src/wp-admin/network/settings.php @@ -119,7 +119,7 @@ if ( isset( $_GET['updated'] ) ) { ?>
-

+

diff --git a/src/wp-admin/network/site-info.php b/src/wp-admin/network/site-info.php index 446db733e4..61fea29850 100644 --- a/src/wp-admin/network/site-info.php +++ b/src/wp-admin/network/site-info.php @@ -137,7 +137,7 @@ require( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

+

'; - echo '

' . esc_html( $title ) . '

'; + echo '

' . esc_html( $title ) . '

'; $url = self_admin_url('update.php?action=update-selected&plugins=' . urlencode( join(',', $plugins) )); $url = wp_nonce_url($url, 'bulk-update-plugins'); @@ -288,13 +288,13 @@ if ( $action ) { $plugins_to_delete = count( $plugin_info ); ?> -

+

-

+

@@ -446,13 +446,13 @@ if ( !empty($invalid) )
-

' . __('Search results for “%s”') . '', esc_html( $s ) ); ?> -

+ ' . _draft_or_post_title() . ''; - $h2 = sprintf( __( 'Compare Revisions of “%1$s”' ), $post_title ); + $h1 = sprintf( __( 'Compare Revisions of “%1$s”' ), $post_title ); $return_to_post = '' . __( '← Return to post editor' ) . ''; $title = __( 'Revisions' ); @@ -126,7 +126,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

+

(' . $file_show . ')'; ?>
-

+

diff --git a/src/wp-admin/theme-install.php b/src/wp-admin/theme-install.php index 56c20b5859..133820bc63 100644 --- a/src/wp-admin/theme-install.php +++ b/src/wp-admin/theme-install.php @@ -102,7 +102,7 @@ include(ABSPATH . 'wp-admin/admin-header.php'); ?>
-

' . __( 'Upload Theme' ) . ''; echo ' ' . _x( 'Browse', 'themes' ) . ''; } - ?>

+ ?>
diff --git a/src/wp-admin/themes.php b/src/wp-admin/themes.php index 81e0d7512d..56711232da 100644 --- a/src/wp-admin/themes.php +++ b/src/wp-admin/themes.php @@ -124,12 +124,12 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

+

-

+

diff --git a/src/wp-admin/tools.php b/src/wp-admin/tools.php index 692fe9273b..726c55b52a 100644 --- a/src/wp-admin/tools.php +++ b/src/wp-admin/tools.php @@ -33,7 +33,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

+

diff --git a/src/wp-admin/update-core.php b/src/wp-admin/update-core.php index c4da56a4b3..8a0b1d84fe 100644 --- a/src/wp-admin/update-core.php +++ b/src/wp-admin/update-core.php @@ -415,7 +415,7 @@ function do_core_upgrade( $reinstall = false ) { ?>
-

+

-

+

'; @@ -624,7 +624,7 @@ if ( 'upgrade-core' == $action ) { require_once(ABSPATH . 'wp-admin/admin-header.php'); echo '

'; - echo '

' . esc_html__('Update Plugins') . '

'; + echo '

' . __( 'Update Plugins' ) . '

'; echo ''; echo '
'; include(ABSPATH . 'wp-admin/admin-footer.php'); @@ -653,7 +653,7 @@ if ( 'upgrade-core' == $action ) { require_once(ABSPATH . 'wp-admin/admin-header.php'); ?>
-

+

-

+

-

+

Switch to the list view.' ); ?>

@@ -206,7 +206,7 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

+

@@ -214,7 +214,7 @@ if ( current_user_can( 'upload_files' ) ) { ?> } if ( ! empty( $_REQUEST['s'] ) ) printf( '' . __('Search results for “%s”') . '', get_search_query() ); ?> -

+
-

+

-

+
-

-

+
diff --git a/src/wp-admin/users.php b/src/wp-admin/users.php index 27e264ca59..5bc5d10c07 100644 --- a/src/wp-admin/users.php +++ b/src/wp-admin/users.php @@ -214,7 +214,7 @@ case 'delete':
-

+

@@ -336,7 +336,7 @@ case 'remove':
-

+

    -

    +

    @@ -454,7 +454,7 @@ if ( current_user_can( 'create_users' ) ) { ?> if ( $usersearch ) printf( '' . __('Search results for “%s”') . '', esc_html( $usersearch ) ); ?> -

    + views(); ?> diff --git a/src/wp-admin/widgets.php b/src/wp-admin/widgets.php index 57f00a94be..5550cae5f5 100644 --- a/src/wp-admin/widgets.php +++ b/src/wp-admin/widgets.php @@ -235,7 +235,7 @@ if ( isset($_GET['editwidget']) && $_GET['editwidget'] ) { require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
    -

    +

    >

    @@ -315,7 +315,7 @@ $errors = array( require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
    -

    +

    ); } ?> -

    +