get_post_custom()
get_post_custom( int $post_id )
基于post ID检索post元字段。
Retrieve post meta fields, based on post ID.
说明(Description)
在可能的情况下,post元字段将从缓存中检索,因此该函数被优化为可多次调用。
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$post_id | (int) | 可选 | Post ID。默认值是全局$Post的ID。 |
返回(Return)
(array)给定Post的Post meta。
源码(Source)
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
1.2.0 | wp-includes/post.php:2209 | 7 | 3 |
笔记(Notes)
默认用法
get_post_custom() 为WP2原创文章,链接:https://www.wp2.cn/functions/get_post_custom/