wordpress函数get_post_custom_keys()
get_post_custom_keys( int $post_id )
检索文章的元字段名。
Retrieve meta field names for a post.
说明(Description)
如果没有元字段,则不返回任何内容(空)。
参数(Parameters)
参数 | 类型 | 必填 | 说明 |
---|---|---|---|
$post_id | (int) | 可选 | Post ID。默认值是全局$Post的ID。 |
返回(Return)
(array|void)键的数组(array|void)。
源码(Source)
/**
* Retrieve meta field names for a post.
*
* If there are no meta fields, then nothing (null) will be returned.
*
* @since 1.2.0
*
* @param int $post_id Optional. Post ID. Default is ID of the global $post.
* @return array|void Array of the keys, if retrieved.
*/
function get_post_custom_keys( $post_id = 0 ) {
$custom = get_post_custom( $post_id );
if ( !is_array($custom) )
return;
if ( $keys = array_keys($custom) )
return $keys;
}
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
1.2.0 | wp-includes/post.php:2228 | 2 | 1 function |
版权声明:原创作品,未经允许不得转载,否则将追究法律责任。
本站资源有的自互联网收集整理,如果侵犯了您的合法权益,请联系本站我们会及时删除。
本站资源仅供研究、学习交流之用,若使用商业用途,请购买正版授权,否则产生的一切后果将由下载用户自行承担。
本文链接:子佩工作室https://zptheme.com/5479.html
许可协议:《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权
本站资源有的自互联网收集整理,如果侵犯了您的合法权益,请联系本站我们会及时删除。
本站资源仅供研究、学习交流之用,若使用商业用途,请购买正版授权,否则产生的一切后果将由下载用户自行承担。
本文链接:子佩工作室https://zptheme.com/5479.html
许可协议:《署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0)》许可协议授权