pre_wp_is_site_initialized хук-фильтрWP 5.1.0

Filters the check for whether a site is initialized before the database is accessed.

Returning a non-null value will effectively short-circuit the function, returning that value instead.

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

add_filter( 'pre_wp_is_site_initialized', 'wp_kama_pre_wp_is_site_initialized_filter', 10, 2 );

/**
 * Function for `pre_wp_is_site_initialized` filter-hook.
 * 
 * @param bool|null $pre     The value to return instead.
 * @param int       $site_id The site ID that is being checked.
 *
 * @return bool|null
 */
function wp_kama_pre_wp_is_site_initialized_filter( $pre, $site_id ){

	// filter...
	return $pre;
}
$pre(true|false|null)
The value to return instead.
По умолчанию: null to continue with the check
$site_id(int)
The site ID that is being checked.

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

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

Где вызывается хук

wp_is_site_initialized()
pre_wp_is_site_initialized
wp-includes/ms-site.php 908
$pre = apply_filters( 'pre_wp_is_site_initialized', null, $site_id );

Где используется хук в WordPress

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