通过转发器字段值查询自定义帖子类型

时间:2018-08-02 20:31:41

标签: php wordpress custom-post-type advanced-custom-fields

我尝试通过转发器字段ID值查询我的自定义帖子类型event-group

$results = new WP_Query(
        [
            'posts_per_page' => -1,
            'post_type'      => 'event-group',
            'post_status'    => 'publish',
            'meta_query'    => [
                [
                    'key'       => 'manifestations_%_manifestations_selectionnees',
                    'value'     => $eventId,
                    'compare' => '='
                ]
            ]
        ]
    );

我的中继器字段名称为manifestations,子字段名称为manifestations_selectionnees

manifestations_selectionnees是一个对象字段。这是一个显示event个自定义帖子类型的选择字段。

ACF字段截图:

enter image description here

对不起,我的英语不好

0 个答案:

没有答案
相关问题