epl_shortcode_results_message Action and Filters

When no results are available for the [listing_category] shortcode, [listing_advanced] shortcode and [listing_open] shortcode a message is displayed. This message can be altered using the included filters or disabled completely and replaced with your own hook.

Replacing all messages with your own code

The default messages are passed through a sanitisation filter preventing any html being output. So if you need some fancy html then you can disable the default action and create your own with HTML.

Create your custom function for example

<?php
// HTML output messages.
function my_epl_shortcode_results_message( $shortcode = 'default' ) {
	
	// If the shortcode is [listing_open]
	if ( 'open' === $shortcode ) {
		?>
		<p>My own message for listings that are open, and whatever html I wan to add with links etc.</p>
		<?php
	} else {
		?>
		<p>My own message and whatever html I wan to add with links etc.</p>
		<?php
	}
}
add_action( 'epl_shortcode_results_message', 'my_epl_shortcode_results_message' );

// Disable the default messages.
function disable_epl_shortcode_results_message_default() {
	remove_action( 'epl_shortcode_results_message', 'epl_shortcode_results_message_callback' );
}
add_action( 'wp', 'disable_epl_shortcode_results_message_default' );

The above example will add new messages and remove the default messages.


Default Messages

You can alter the default messages using the following filters.

epl_shortcode_results_message is the action and the epl_shortcode_results_message_callback function provides the hooks with messages.

There are two filters that allow you to adjust the message displayed when no listings results are found. 


Nothing found, please check back later. - Filter: epl_shortcode_results_message_title

You can modify the title displayed when using the [listing_category] and [listing_advanced] shortcodes and no results are found using a simple function placed in your theme function file or custom plugin.

epl_shortcode_results_message_title

Example function to modify the title:

function my_epl_shortcode_results_message_title( $label ) { 	$label = 'My Custom Title'; 	return $label; } add_filter( 'epl_shortcode_results_message_title' , 'my_epl_shortcode_results_message_title' );

Default message displayed for the [listing_category] and [listing_advanced] shortcodes is:

Nothing found, please check back later.


Nothing currently scheduled for inspection, please check back later. Filter: epl_shortcode_results_message_title_open

You can modify the message displayed when using the [listing_open] shortcode and no results are displayed using a simple function placed in your theme function file or custom plugin.

epl_shortcode_results_message_title_open

Example function to modify the message:

function my_epl_shortcode_results_message_title_open( $label ) {
	$label = 'My Custom Message';
	return $label;
}
add_filter( 'epl_shortcode_results_message_title_open' , 'my_epl_shortcode_results_message_title_open' );

Default message displayed for the [listing_open] shortcodes is:

Nothing currently scheduled for inspection, please check back later.