Php 按字段值筛选重力表单条目
我试图回显重力表单条目列表,但只想回显特定字段中具有特定值的条目 例如,$entry['53']是表单中的一个字段,允许用户从下拉列表中进行选择。只有两种选择。假设A和B。我如何修改下面的代码,使其只显示值为B的条目 我目前掌握的代码是:Php 按字段值筛选重力表单条目,php,wordpress,gravity-forms-plugin,Php,Wordpress,Gravity Forms Plugin,我试图回显重力表单条目列表,但只想回显特定字段中具有特定值的条目 例如,$entry['53']是表单中的一个字段,允许用户从下拉列表中进行选择。只有两种选择。假设A和B。我如何修改下面的代码,使其只显示值为B的条目 我目前掌握的代码是: <?php //Get the Form ID to get the entries from and store it within a varibale $search_criteria = null; $s
<?php
//Get the Form ID to get the entries from and store it within a varibale
$search_criteria = null;
$sorting = null;
$paging = null;
$entries = GFAPI::get_entries( $form_id, $search_criteria, $sorting, $paging );
echo '<ul>';
foreach($entries as $entry) :
echo '<li>Title: ' . $entry['2'] . '</li>';
endforeach;
echo '</ul>';
?>
非常感谢试试这个:
$search_criteria = array(
'status' => 'active',
'field_filters' => array(
array(
'key' => '53',
'value' => 'B',
),
)
);
试试这个:
$search_criteria = array(
'status' => 'active',
'field_filters' => array(
array(
'key' => '53',
'value' => 'B',
),
)
);
如果我不知道该字段的键但只知道标签怎么办?如果我不知道该字段的键但只知道标签怎么办?