From bc9446bd69275ca5cccd5c2ede09522bb1ab2db4 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 28 Oct 2014 18:14:18 +0000 Subject: [PATCH] Make the Twenty Fifteen search form submit button screen reader accessible rather than hidden to all users. Fixes #30110. Props mattweibe, rianrietveld. Built from https://develop.svn.wordpress.org/trunk@30053 git-svn-id: http://core.svn.wordpress.org/trunk@30053 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentyfifteen/functions.php | 14 ++++++++++++++ wp-content/themes/twentyfifteen/style.css | 4 ---- wp-includes/version.php | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/wp-content/themes/twentyfifteen/functions.php b/wp-content/themes/twentyfifteen/functions.php index 776f06a252..c1c5281743 100644 --- a/wp-content/themes/twentyfifteen/functions.php +++ b/wp-content/themes/twentyfifteen/functions.php @@ -310,6 +310,20 @@ function twentyfifteen_nav_description( $item_output, $item, $depth, $args ) { } add_filter( 'walker_nav_menu_start_el', 'twentyfifteen_nav_description', 10, 4 ); +/** + * Add a `screen-reader-text` class to the search form's submit button + * + * @since Twenty Fifteen 1.0 + * + * @param string $html Search form HTML + * + * @return string Modified search form HTML + */ +function twentyfifteen_search_form_modify( $html ) { + return str_replace( 'class="search-submit"', 'class="search-submit screen-reader-text"', $html ); +} +add_filter( 'get_search_form', 'twentyfifteen_search_form_modify' ); + /** * Implement the Custom Header feature. * diff --git a/wp-content/themes/twentyfifteen/style.css b/wp-content/themes/twentyfifteen/style.css index d380f5f55e..c81c6e8bc6 100644 --- a/wp-content/themes/twentyfifteen/style.css +++ b/wp-content/themes/twentyfifteen/style.css @@ -596,10 +596,6 @@ textarea { bottom: 0; } -.search-form input[type="submit"] { - display: none; -} - /** * 6.0 Navigations diff --git a/wp-includes/version.php b/wp-includes/version.php index b58c753fb1..1baee4e6b4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.1-alpha-30052'; +$wp_version = '4.1-alpha-30053'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.