Make WordPress Core

Changeset 30053


Ignore:
Timestamp:
10/28/2014 06:13:19 PM (10 years ago)
Author:
johnbillion
Message:

Make the Twenty Fifteen search form submit button screen reader accessible rather than hidden to all users. Fixes #30110. Props mattweibe, rianrietveld.

Location:
trunk/src/wp-content/themes/twentyfifteen
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyfifteen/functions.php

    r30046 r30053  
    312312
    313313/**
     314 * Add a `screen-reader-text` class to the search form's submit button
     315 *
     316 * @since Twenty Fifteen 1.0
     317 *
     318 * @param string $html Search form HTML
     319 *
     320 * @return string Modified search form HTML
     321 */
     322function twentyfifteen_search_form_modify( $html ) {
     323    return str_replace( 'class="search-submit"', 'class="search-submit screen-reader-text"', $html );
     324}
     325add_filter( 'get_search_form', 'twentyfifteen_search_form_modify' );
     326
     327/**
    314328 * Implement the Custom Header feature.
    315329 *
  • trunk/src/wp-content/themes/twentyfifteen/style.css

    r30049 r30053  
    597597}
    598598
    599 .search-form input[type="submit"] {
    600     display: none;
    601 }
    602 
    603599
    604600/**
Note: See TracChangeset for help on using the changeset viewer.