site_url хук-фильтрWP 2.7.0

Filters the site URL.

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

add_filter( 'site_url', 'wp_kama_site_url_filter', 10, 4 );

/**
 * Function for `site_url` filter-hook.
 * 
 * @param string      $url     The complete site URL including scheme and path.
 * @param string      $path    Path relative to the site URL. Blank string if no path is specified.
 * @param string|null $scheme  Scheme to give the site URL context. Accepts 'http', 'https', 'login', 'login_post', 'admin', 'relative' or null.
 * @param int|null    $blog_id Site ID, or null for the current site.
 *
 * @return string
 */
function wp_kama_site_url_filter( $url, $path, $scheme, $blog_id ){

	// filter...
	return $url;
}
$url(строка)
The complete site URL including scheme and path.
$path(строка)
Path relative to the site URL. Blank string if no path is specified.
$scheme(строка|null)
Scheme to give the site URL context. Accepts 'http', 'https', 'login', 'login_post', 'admin', 'relative' or null.
$blog_id(int|null)
Site ID, or null for the current site.

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

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

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

get_site_url()
site_url
wp_is_site_url_using_https()
site_url
wp-includes/link-template.php 3527
return apply_filters( 'site_url', $url, $path, $scheme, $blog_id );
wp-includes/https-detection.php 58
$site_url = apply_filters( 'site_url', get_option( 'siteurl' ), '', null, null );

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

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