首页 WordPress函数大全 clean_url()

clean_url()

2020-05-01 / 2606阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

Warning: This function has been deprecated. Use esc_url() instead.

clean_url( string $url, array $protocols = null, string $context = 'display' )

Checks and cleans a URL.

描述

A number of characters are removed from the URL. If the URL is for displaying (the default behaviour) ampersands are also replaced. The ‘clean_url’ filter is applied to the returned cleaned URL.

See also See also

  • esc_url()

Top ↑

参数

$url

(string)
(Required)
The URL to be cleaned.

$protocols

(array)
(Optional)
An array of acceptable protocols.

Default value: null

$context

(string)
(Optional)
How the URL will be used. Default is 'display'.

Default value: 'display'

返回

(string) The cleaned $url after the 'clean_url' filter is applied.

大家谈论
    我的见解