Created
May 24, 2018 18:29
-
-
Save Shelob9/540388ad2b9b46983891f7f02ca0d555 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Select all entries from form | |
*/ | |
$form = Caldera_Forms_Forms::get_form( 'cf12345' ); | |
$paginated = new Caldera_Forms_Query_Paginated($form); | |
/** Get first 25 entries from form */ | |
/** @var Caldera_Forms_Entry_Field $value */ | |
foreach ( $paginated->select_all() as $value ){ | |
echo $value->get_value(); | |
} | |
//Set page 2 | |
$paginated->set_page(2 ); |
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 | |
$form = Caldera_Forms_Forms::get_form( 'cf12345' ); | |
$paginated = new Caldera_Forms_Query_Paginated($form); | |
//Access main FeatureContainer for Caldera Forms Queries | |
$entryValueSelect = $paginated->get_queries_container() | |
->getQueries() | |
->entryValuesSelect(); | |
//Create query by field value | |
$entryValueSelect | |
>is('value', 'Roy@HiRoy.club'); | |
//Get results | |
$results = $paginated | |
->get_queries_container() | |
->getQueries() | |
->select( $entryValueSelect ); |
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 | |
$form = Caldera_Forms_Forms::get_form( 'cf12345' ); | |
$paginated = new Caldera_Forms_Query_Paginated($form); | |
/** Change per page (limit) */ | |
$paginated->set_limit(50); //Max is 100 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment