发布时间:2020-09-17
WordPress 常用函数 / esc_url_raw,
esc_url_raw() 函数类似与 esc_url() (实际上 esc_url_raw 函数中就使用了 esc_url ),但是不同于 esc_url(),它不会将字符转换成 HTML 实体用于显示,它的结果适用于在数据库查询等操作,重定向,或者 HTTP 请求中。
<?php esc_url_raw( $url, $protocols ); ?>
$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: 无
(string)
已经清理过滤的 URL
Since: 2.8
wp-includes/formatting.php
全站搜索