get_post_custom_keys
get_post_custom_keys用于获取当前文章所有的自定义字段的键值。
if (have_posts()) : while (have_posts()) : the_post(); var_dump(get_post_custom_keys()); endwhile; endif;
大致会获得 以下结果:
(如果自定义字段有设置)
array(4) {
[0]=>
string(10) “_edit_last”
[1]=>
string(10) “_edit_lock”
[2]=>
string(13) “_thumbnail_id”
[3]=>
string(6) “xzmeta”
}