set_404 action-hookWP 5.5.0

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

WP_Query::set_404()
set_404
wp-includes/class-wp-query.php 1819
do_action_ref_array( 'set_404', array( $this ) );

Where the hook is used in WordPress

Usage not found.