• Resolved Sami Keijonen

    (@samikeijonen)


    Twenty15 adds screen-reader-text class to search form like this.

    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' );

    I was wondering would it be better way to just add the same CSS rules in search-submit like this.

    .screen-reader-text,
    .search-submit {
    
       // Same CSS rules
    
    }

    The reason I ask this is because when search plugin is also filtering get_search_form they won’t work well together.

    This is small detail but sometimes it’s all about details. I’m not saying is theme or plugin doing this wrong or right way, just trying to figure out the best compromise and compatibility.

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filterin get_search_form’ is closed to new replies.