clean_url()
Устарела с версии 3.0.0. Больше не поддерживается и может быть удалена. Используйте esc_url().
Checks and cleans a URL.
A number of characters are removed from the URL. If the URL is for displaying (the default behavior) ampersands are also replaced. The clean_url is applied to the returned cleaned URL.
Хуков нет.
Возвращает
string. The cleaned $url after the clean_url filter is applied.
Использование
clean_url( $url, $protocols, $context );
- $url(строка) (обязательный)
- The URL to be cleaned.
- $protocols(массив)
- An array of acceptable protocols.
По умолчанию:null - $context(строка)
- How the URL will be used.
По умолчанию:'display'
Заметки
| Смотрите: esc_url() |
Список изменений
| С версии 1.2.0 | Введена. |
| Устарела с 3.0.0 | Use esc_url() |
Код clean_url() clean url WP 7.1.3
function clean_url( $url, $protocols = null, $context = 'display' ) {
if ( $context == 'db' )
_deprecated_function( 'clean_url( $context = \'db\' )', '3.0.0', 'sanitize_url()' );
else
_deprecated_function( __FUNCTION__, '3.0.0', 'esc_url()' );
return esc_url( $url, $protocols, $context );
}