我正在使用Ajax在弹出窗口中显示帖子。我找不到关于获得post meta的真实方式的信息。
我可以单独获取元字段:
$project_client = get_post_meta( $postId, 'project_client',true );
$project_date = get_post_meta( $postId, 'project_date',true );
$project_place = get_post_meta( $postId, 'project_place',true );
echo $project_client;
或一次性全部:
$post_meta = get_post_meta( $post_id ); // array of all meta fields
echo $post_meta['project_client'][0];
哪种方式是对的?