set_404
Fires after a 404 is triggered.
Usage
add_action( 'set_404', 'wp_kama_set_404_action' ); /** * Function for `set_404` action-hook. * * @param WP_Query $query The WP_Query instance (passed by reference). * * @return void */ function wp_kama_set_404_action( $query ){ // action... }
- $query(WP_Query)
- The WP_Query instance (passed by reference).
Changelog
Since 5.5.0 | Introduced. |
Where the hook is called
set_404
wp-includes/class-wp-query.php 1848
do_action_ref_array( 'set_404', array( $this ) );