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 数组?谢谢。
Post 元数据函数结构是这样的:
<?php $meta_values = get_post_meta($post_id, $key, $single); ?>
因此,如果您的 $post_id 变量是数组,那么您可以使用如下内容:
<?php $meta_values = get_post_meta($post_id[0], $key, $single); ?>