get_url_in_content
函数
get_url_in_content ( $content )
- 参数
-
-
(string)
$content
A string which might contain a URL.- Required: 是
-
(string)
- 返回值
-
- (string|false) The found URL.
- 定义位置
-
-
wp-includes/formatting.php
, line 5655
-
wp-includes/formatting.php
- 引入
- 3.6.0
- 弃用
- –
从传来的内容中提取并返回第一个URL。
function get_url_in_content( $content ) { if ( empty( $content ) ) { return false; } if ( preg_match( '/]*?href=(['"])(.+?)1/is', $content, $matches ) ) { return sanitize_url( $matches[2] ); } return false; }
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。