Disable the ability to search the placeholder text in the drop-down list

Hi,

The categories field has multiple categories which can be searchable. However, the first option is not a “searchable category” but just a “command text”. In my case, the searchable text is “What services are you looking for”
The problem is that buyers are able to select this “command text” and search which of course will show no results but it makes no sense that this text is even searchable at all. How can I make this text unsearchable? Please see screenshot.

Please make sure that you have added placeholder for the category field in the search form with this PHP snippet. If you have added placeholder as one of the options then it will be searchable

add_filter(
	'hivepress/v1/forms/listing_search',
	function( $form ) {
		if ( isset( $form['fields']['_category'] ) ) {
			$form['fields']['_category']['placeholder'] = 'custom text here';
		}

		return $form;
	},
	1000
);

If the issue persists then please send temporary WP access to support@hivepress.io with details for reproducing this issue and we’ll check it. You can create a temporary access link using this plugin Temporary Login Without Password – WordPress plugin | WordPress.org

Hi @yevhen I think you misunderstood my question. I will like to make the placeholder “unsearchable” Thanks

Please try to add a placeholder for the select field with the code snippet which is provided above

If the issue persists then please send temporary WP access to support@hivepress.io with details for reproducing this issue and we’ll check it. You can create a temporary access link using this plugin Temporary Login Without Password – WordPress plugin | WordPress.org

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.