wphooks.info - pre_handle_404

pre_handle_404

(trunk - 5.1-alpha-44286)

The hook occurs in the following file:

wp-includes/class-wp.php:
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
		 * Filters whether to short-circuit default header status handling.
		 *
		 * Returning a non-false value from the filter will short-circuit the handling
		 * and return early.
		 *
		 * @since 4.5.0
		 *
		 * @param bool     $preempt  Whether to short-circuit default header status handling. Default false.
		 * @param WP_Query $wp_query WordPress Query object.
		 */
		if ( false !== apply_filters( 'pre_handle_404', false, $wp_query ) ) {
			return;
		}

		// If we've already issued a 404, bail.
		if ( is_404() ) {
			return;
		}

		// Never 404 for the admin, robots, or if we found posts.