rentfetch_search_placeholder_text
The rentfetch_search_placeholder_text filter allows developers to customize the placeholder text displayed in the text-based search input field within Rent Fetch’s property search functionality. This filter provides a simple way to change the default “Search…” text to something more specific to your site’s needs or audience.
Parameters
apply_filters( 'rentfetch_search_placeholder_text', 'Search...' );
- Parameter:
$placeholder(string) – The placeholder text to display in the search input - Returns: (string) – Modified placeholder text
When This Filter Runs
This filter executes in the rentfetch_search_filters_text_search() function, which is called:
- In property search dialog filters (
rentfetch_do_search_properties_dialog_filtersaction) - In featured property search filters (
rentfetch_do_search_properties_featured_filtersaction) - When displaying the
[rentfetch_search_filters]shortcode with text search enabled
Usage Examples
Basic: Change Default Placeholder Text
add_filter( 'rentfetch_search_placeholder_text', 'custom_search_placeholder' );
function custom_search_placeholder( $placeholder ) {
return 'Find your perfect home...';
}
Contextual: Different Placeholders for Different Pages
add_filter( 'rentfetch_search_placeholder_text', 'contextual_search_placeholder' );
function contextual_search_placeholder( $placeholder ) {
// Different placeholder based on current page
if ( is_page( 'apartments' ) ) {
return 'Search apartments by location, amenities...';
} elseif ( is_page( 'houses' ) ) {
return 'Find houses in your area...';
} elseif ( is_page( 'commercial' ) ) {
return 'Search commercial properties...';
}
return 'Search properties...';
}