From cc6925d1d53d1133de7ccb89cb5f0c5dc10256ad Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Thu, 27 Oct 2016 20:38:09 +0000 Subject: [PATCH] Accessibility: Remove inappropriate content from the Posts and Edit screens headings. Props grahamarmfield, SergeyBiryukov, trishasalas, valendesigns, rianrietveld, afercia. See #26601. git-svn-id: https://develop.svn.wordpress.org/trunk@38983 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/css/common.css | 20 +++++++++++++++++++- src/wp-admin/edit-form-advanced.php | 13 ++++++++++--- src/wp-admin/edit.php | 12 +++++++++--- src/wp-admin/js/common.js | 10 ++++++++-- src/wp-includes/js/autosave.js | 13 +++++++++++-- 5 files changed, 57 insertions(+), 11 deletions(-) diff --git a/src/wp-admin/css/common.css b/src/wp-admin/css/common.css index 6e6504ad46..9b127c5195 100644 --- a/src/wp-admin/css/common.css +++ b/src/wp-admin/css/common.css @@ -572,10 +572,20 @@ code { font-size: 23px; font-weight: 400; margin: 0; - padding: 9px 15px 4px 0; + padding: 9px 0 4px 0; line-height: 29px; } +.wrap h1.wp-heading-inline { + display: inline-block; + margin-right: 5px; +} + +.wp-header-end { + visibility: hidden; + margin: -2px 0 0; +} + .subtitle { margin: 0; padding-left: 25px; @@ -608,6 +618,10 @@ code { outline: 0; } +.wrap .wp-heading-inline + .page-title-action { + margin-left: 0; +} + .wrap .add-new-h2:hover, /* deprecated */ .wrap .page-title-action:hover { border-color: #008EC2; @@ -3654,6 +3668,10 @@ img { display: none !important; } + .wrap h1.wp-heading-inline { + margin-bottom: 0.5em; + } + .wrap .add-new-h2, /* deprecated */ .wrap .add-new-h2:active, /* deprecated */ .wrap .page-title-action, diff --git a/src/wp-admin/edit-form-advanced.php b/src/wp-admin/edit-form-advanced.php index 73cb63b8e3..392b51406d 100644 --- a/src/wp-admin/edit-form-advanced.php +++ b/src/wp-admin/edit-form-advanced.php @@ -474,11 +474,18 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' ); ?>
-

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

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

diff --git a/src/wp-admin/edit.php b/src/wp-admin/edit.php index 223e8b90ab..3b11eb71b7 100644 --- a/src/wp-admin/edit.php +++ b/src/wp-admin/edit.php @@ -303,16 +303,22 @@ $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 ) ) +?>

+ +cap->create_posts ) ) { echo ' ' . esc_html( $post_type_object->labels->add_new ) . ''; +} if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) { /* translators: %s: search keywords */ printf( ' ' . __( 'Search results for “%s”' ) . '', get_search_query() ); } -?> +?> + +