How do I use the GFAPI class from Gravity Forms? I want to get all the entries from a given form. But nothing seems to work.. Do I need to import/include/require the class?
<?php
getEntries();
function getEntries() {
$form_id = 73;
$search_criteria = array();
$entries = GFAPI::get_entries($form_id, $search_criteria);
exit(var_dump($entries));
}
When I open the file, it doens't work, and I have a feeling it's because it can't find the class.
In the GF docs, it says: "The API Functions are automatically included when Gravity Forms loads and they will be available by the time add-ons load. The API class is called GFAPI and it can be found in /plugins/gravityforms/includes/api.php.".