loop_no_results
Fires if no results are found in a post query.
Usage
add_action( 'loop_no_results', 'wp_kama_loop_no_results_action' ); /** * Function for `loop_no_results` action-hook. * * @param WP_Query $query The WP_Query instance. * * @return void */ function wp_kama_loop_no_results_action( $query ){ // action... }
- $query(WP_Query)
- The WP_Query instance.
Changelog
Since 4.9.0 | Introduced. |
Where the hook is called
loop_no_results
wp-includes/class-wp-query.php 3848
do_action( 'loop_no_results', $this );