wp_should_replace_insecure_home_url хук-фильтрWP 5.7.0

Filters whether WordPress should replace old HTTP URLs to the site with their HTTPS counterpart.

If a WordPress site had its URL changed from HTTP to HTTPS, by default this will return true. This filter can be used to disable that behavior, e.g. after having replaced URLs manually in the database.

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

add_filter( 'wp_should_replace_insecure_home_url', 'wp_kama_should_replace_insecure_home_url_filter' );

/**
 * Function for `wp_should_replace_insecure_home_url` filter-hook.
 * 
 * @param bool $should_replace_insecure_home_url Whether insecure HTTP URLs to the site should be replaced.
 *
 * @return bool
 */
function wp_kama_should_replace_insecure_home_url_filter( $should_replace_insecure_home_url ){

	// filter...
	return $should_replace_insecure_home_url;
}
$should_replace_insecure_home_url(true|false)
Whether insecure HTTP URLs to the site should be replaced.

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

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

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

wp_should_replace_insecure_home_url()
wp_should_replace_insecure_home_url
wp-includes/https-migration.php 37
return apply_filters( 'wp_should_replace_insecure_home_url', $should_replace_insecure_home_url );

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

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