参数
$帖子id 整数 必需的 帖子ID。
来源
公共函数get_custom_fields($post_id){ $post_id=(int)$post_id; $custom_fields=数组(); foreach((数组)将_meta($post_id)作为$meta){ //不要暴露受保护的字段。 if(!current_user_can('edit_post_meta',$post_id,$meta['meta_key'])){ 继续; } $custom_fields[]=数组( “id”=>$meta[“meta_id”], “key”=>$meta['meta_key'], “value”=>$meta['meta_value'], ); } 返回$custom_fields; }