Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
post_id のみが指定されている特定の post_meta データを取得するにはどうすればよいでしょうか。私の post_id は ID の配列であることに注意してください。ありがとう。
ポストメタデータ関数の構造は次のとおりです。
<?php $meta_values = get_post_meta($post_id, $key, $single); ?>
したがって、$ post_id変数が配列の場合、次のようなものを使用できます。
<?php $meta_values = get_post_meta($post_id[0], $key, $single); ?>