wordpress - 重力形式 api get_entries 限制为 20

标签 wordpress plugins gravity-forms-plugin

这似乎是一个极其简单的问题,但无论我如何分割它,即使 GFAPI::count_entries() 返回 52,重力形式也只显示 20 个条目。

代码如下:

$form_id=16; 
$search_criteria = array( 'status' => 'active' );
$total_entries = GFAPI::count_entries( $form_id, $search_criteria );
echo '<h3>Count of entries: '.$total_entries.'</h4>';
// shows: Count of entries: 52 as expected

// great, now process each entry and get specific fields
$paging = array( 'offset' => 0, 'page_size' => 60 );
$allentries = GFAPI::get_entries( $form_id, $paging );
echo '<h3>Count of entries: '.count($allentries).'</h4>';
// shows: Count of entries: 20

$entryid = 25; // known data item
$firstEntry = GFAPI::get_entry( $entryid );
echo '<h4>Name for 25: '.$firstEntry[20].'</h4>';
// shows: Name for 25: Todd

$entryid = 189; // known data item
$midEntry = GFAPI::get_entry( $entryid );
echo '<h4>Name for 189: '.$midEntry[20].'</h4>';
// shows: Name for 189: Steve

$entryid = 525; // known data item
$lastEntry = GFAPI::get_entry( $entryid );
echo '<h4>Name for 525: '.$lastEntry[20].'</h4>';
// shows: Name for 525: Graylin

我添加了 $page 参数、$search 等,但没有任何效果...我只获取了最后提交的 20 条记录。

我的目标是循环访问条目并获取特定字段(例如,firstname=[20] 等)。

非常感谢这里的指导。

最佳答案

试试这个:

$entries = GFAPI::get_entries( $form_id, $search_criteria, null, $paging );

关于wordpress - 重力形式 api get_entries 限制为 20,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39309258/

相关文章:

php - WordPress 错误 "A variable mismatch has been detected."

css - 网站不会居中

javascript - 现有模板的 Wordpress 大型菜单小部件移​​动样式问题

wordpress - 带有 wordpress 的 Varnish 破坏了 wordpress 可视化编辑器?

css - 属性选择器: Can't isolate one element from the other

html - 将 Gravity Forms 的提交按钮放在表单下方的中心

wordpress - 在所有 URLS 上强制使用 ssl

zend-framework - 如何使用 Zend Framework 检查 Controller 是否存在

javascript - 在重力形式计算中使用指数

jquery - 如何在列中显示列表项