wordpress snippets last updated   : August 18, 2014
we now have 638 snippets

Remove role=”search” in get_search_form()

wordpress snippet

Adding this PHP snippet to the functions.php of your wordpress theme will remove the role=”search” from the get_search_form() HTML output. Please note that role is an attribute introduced in XHTML draft for accessibility however does not validate.

snippet :  PHPcopy
function valid_search_form ($form) {
    return str_replace('role="search" ', '', $form);
}
add_filter('get_search_form', 'valid_search_form');

Did you like this post? If so please share it with your friends. Thanks!