【发布时间】:2019-07-28 07:59:25
【问题描述】:
我试图理解为什么一个包含整数的变量只能用来替换 GFAPI::get_entries field_filters 值中的整数。 这有效:
$search_criteria = array(
'status' => 'active',
'field_filters' => array(
'mode' => 'any',
array(
'key' => 'gpnf_entry_parent',
'value' => '72'
)
)
);
这不起作用:
$child_entry_ID = "{entry_id}";
$child_entry_ID 是 72。当然
echo $child_entry_ID . "<br />";
打印“72”
$search_criteria = array(
'status' => 'active',
'field_filters' => array(
'mode' => 'any',
array(
'key' => 'gpnf_entry_parent',
'value' => $child_entry_ID
)
)
);
我是这样用的
$entry2 = GFAPI::get_entries(33, $search_criteria);
print_r($entry2);
在有效的情况下,我的数组打印正确,在无效的情况下,我得到“Array()。
【问题讨论】:
标签: php forms variables filter gravity