wpsl_no_results

  1. Description
  2. Usage
  3. Changelog
  4. Source File

Description

This filter allows you to create a custom HTML block informing the user that the search returned no results. It replaces the text from the “No results found” field on the settings page.

Usage

add_filter( 'wpsl_no_results', 'custom_no_results' );

function custom_no_results() {
    
    $output = '<h2>No results found!</h2>';
    $output .= '<p>Please contact us at <a href="tel:123456">+123456</a> or <a href="mailto:support@mydomain.com">support@mydomain.com</a>.</p>';
    $output .= '<img src="http://mydomain.com/my-logo.jpg" alt="business logo"/>';
    
    return $output;
}

Changelog

Since 2.2

Source File

This filter is located in /frontend/class-frontend.php.