Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 为Wordpress的高级自定义字段(ACF)中的组字段编写元查询_Php_Wordpress_Advanced Custom Fields - Fatal编程技术网

Php 为Wordpress的高级自定义字段(ACF)中的组字段编写元查询

Php 为Wordpress的高级自定义字段(ACF)中的组字段编写元查询,php,wordpress,advanced-custom-fields,Php,Wordpress,Advanced Custom Fields,我认为ACF文档在如何查询由高级自定义字段组成的组的子字段方面非常缺乏 例如: acf_custom_dates_group acf_custom_date_group_child acf\自定义\日期\组 acf_U自定义\u日期\u组\u子 如何对子字段中的值执行meta_查询?这里的技巧是将组和子字段的键名组合起来。我相信喜欢的操作员也是必要的 /* 我的自定义组的名称:acf_custom_dates_group 我的子字段名称:acf\u自定义\u日期\u组\u子字段 名称组合为“键”

我认为ACF文档在如何查询由高级自定义字段组成的组的子字段方面非常缺乏

例如:

acf_custom_dates_group acf_custom_date_group_child acf\自定义\日期\组 acf_U自定义\u日期\u组\u子
如何对子字段中的值执行meta_查询?

这里的技巧是将组和子字段的键名组合起来。我相信喜欢的操作员也是必要的

/*
我的自定义组的名称:acf_custom_dates_group
我的子字段名称:acf\u自定义\u日期\u组\u子字段
名称组合为“键”,用下划线分隔(见下文)
*/
$format_值=“”;//由ajax设置
$myquery=新的WP\u查询([
“每页帖子数”=>-1,
“post_type”=>“posts”,
“元查询”=>[
//'关系'=>'或',
//'关系'=>'和',
[
“键”=>“acf\U自定义日期\U组\U acf\U自定义日期\U组子项”,
'比较'=>'类似',
“值”=>$format\u值
],
],
]);