1. Home
  2. Developer
  3. How-To Guides
  4. How to add “Please Select” to dropdown
  1. Home
  2. Developer
  3. Code Snippets
  4. How to add “Please Select” to dropdown

How to add “Please Select” to dropdown

If you need to add a prompt to a select in an application form you will need to use a filter like this.

add_filter( 'matador_application_form_args', function( $args ) {

	$args["fields"]['name_of_option']['options'] = array( "" => __( "Please select", 'text_domain' ) ) + $args["fields"]['name_of_option']['options'];

	return $args;
}, 99 );

Change the “name_of_option” to match the name the select you need to add it to.

You can do multiple selects in the same function by repeating the line with different names.

Also, update the text_domain to match your site.

Updated on September 24, 2023
Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support