acf_get_current_url()ACF 5.1.5

Returns the current URL.

Хуков нет.

Возвращает

Строку.

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

acf_get_current_url();

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

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

Код acf_get_current_url() ACF 6.0.4

function acf_get_current_url() {
	// Ensure props exist to avoid PHP Notice during CLI commands.
	if ( isset( $_SERVER['HTTP_HOST'], $_SERVER['REQUEST_URI'] ) ) {
		return ( is_ssl() ? 'https' : 'http' ) . '://' . filter_var( $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], FILTER_SANITIZE_URL );
	}
	return '';
}