filter_SSL() WP 2.8.5
Formats a URL to use https.
Useful as a filter.
Хуков нет.
Возвращает
Строку
. URL with https as the scheme
Использование
filter_SSL( $url ) // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid;
- $url(строка) (обязательный)
- URL
Список изменений
С версии 2.8.5 | Введена. |
Код filter_SSL() filter SSL WP 5.7.1
function filter_SSL( $url ) { // phpcs:ignore WordPress.NamingConventions.ValidFunctionName.FunctionNameInvalid
if ( ! is_string( $url ) ) {
return get_bloginfo( 'url' ); // Return home blog URL with proper scheme.
}
if ( force_ssl_content() && is_ssl() ) {
$url = set_url_scheme( $url, 'https' );
}
return $url;
}