WordPress – Modify Search Widget Placeholder Text

WordPress - General Theme Development PHP

Snippet Overview

WordPress – Modify Search Widget Placeholder Text

Have you ever needed to modify the placeholder text that is associated with the default WordPress Search widget? To add your own custom text all you need to do is add this code to your theme’s functions.php file and customize the text as needed.

/* ----------------------------------------------------------
  Search Widget Placeholder Text
---------------------------------------------------------- */

function my_frontend_search_form_param( array $params ) {
	$params['placeholder'] = __('Search ...','avia_framework');
	
	return $params;
}

add_filter('avf_frontend_search_form_param', 'my_frontend_search_form_param', 10, 1 );
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply