发布时间:2020-09-17
WordPress 常用函数 / esc_url,
主要用于 URL 过滤:
<?php esc_url( $url, $protocols, $_context ); ?>
$url
(string) (required) 将要被清理过滤的 URL
Default: 无
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script>
$protocols
(array) (optional) 可以接受协议的数组,如果没有设置,默认是:’http’, ‘https’, ‘ftp’, ‘ftps’, ‘mailto’, ‘news’, ‘irc’, ‘gopher’, ‘nntp’, ‘feed’, ‘telnet’。
Default: 无
$_context
(string) (optional) 如何返回 URL。
Default: ‘display’
(string)
已经清理过滤的 URL
Since: 2.8
wp-includes/formatting.php
全站搜索