WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

maybe_redirect_404() WP 3.0.0

Correct 404 redirects when NOBLOGREDIRECT is defined.

Хуки из функции
Возвращает

Null. Ничего.

Использование

maybe_redirect_404();

Список изменений

С версии 3.0.0 Введена.

Код maybe redirect 404: wp-includes/ms-functions.php WP 5.3.2

<?php
function maybe_redirect_404() {
	if ( is_main_site() && is_404() && defined( 'NOBLOGREDIRECT' ) ) {
		/**
		 * Filters the redirect URL for 404s on the main site.
		 *
		 * The filter is only evaluated if the NOBLOGREDIRECT constant is defined.
		 *
		 * @since 3.0.0
		 *
		 * @param string $no_blog_redirect The redirect URL defined in NOBLOGREDIRECT.
		 */
		$destination = apply_filters( 'blog_redirect_404', NOBLOGREDIRECT );
		if ( $destination ) {
			if ( $destination == '%siteurl%' ) {
				$destination = network_home_url();
			}
			wp_redirect( $destination );
			exit();
		}
	}
}