Last active
November 13, 2023 16:11
-
-
Save mainiomooses/a9b13752cad83b8ea6e76ceff02c50f6 to your computer and use it in GitHub Desktop.
GFAPI::get_entries usage with is_read and is_starred field filters alongside other filters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Correct way to use "is_read" and/or "is_starred" with GFAPI::get_entries | |
$search_criteria = array( | |
'status' => 'active', | |
'field_filters' => array( | |
'mode' => 'all', | |
array( | |
'key' => '8', | |
'value' => 'abc', | |
), | |
array( | |
'key' => 'is_read', | |
'value' => 1, | |
), | |
) | |
); | |
$paging = array( | |
'offset' => 0, | |
'page_size' => 0 | |
); | |
// Now returns results with field id 8 having value "abc" and only if the entry has been marked read | |
$entries = GFAPI::get_entries( 32, $search_criteria, null, $paging ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment