From 105b60bd0b2ced800ff0012b8f6b72c98d0af40d Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Tue, 28 Oct 2014 18:13:19 +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. git-svn-id: https://develop.svn.wordpress.org/trunk@30053 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-content/themes/twentyfifteen/functions.php | 14 ++++++++++++++ src/wp-content/themes/twentyfifteen/style.css | 4 ---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/wp-content/themes/twentyfifteen/functions.php b/src/wp-content/themes/twentyfifteen/functions.php index 776f06a252..c1c5281743 100644 --- a/src/wp-content/themes/twentyfifteen/functions.php +++ b/src/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/src/wp-content/themes/twentyfifteen/style.css b/src/wp-content/themes/twentyfifteen/style.css index d380f5f55e..c81c6e8bc6 100644 --- a/src/wp-content/themes/twentyfifteen/style.css +++ b/src/wp-content/themes/twentyfifteen/style.css @@ -596,10 +596,6 @@ textarea { bottom: 0; } -.search-form input[type="submit"] { - display: none; -} - /** * 6.0 Navigations