attachment_url_to_postid()
attachment_url_to_postid( string $url )
尝试将附件URL转换为post ID。
Tries to convert an attachment URL into a post ID.
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$url | (string) | 必需 | 要解析的URL。 |
返回(Return)
(int)找到的post ID,失败时为0。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
4.0.0 | wp-includes/media.php:4312 | 2 | 5 |
笔记(Notes)
从附件URL获取帖子ID
attachment_url_to_postid() 为WP2原创文章,链接:https://www.wp2.cn/functions/attachment_url_to_postid/