The Community forums are being phased out in favor of a new Slack group.
Add your email address below to get an invitation to join the community slack group
Is frm_entry or getAll deprecated with 3.0 and ...
Hi - i had custom code from years back that is now not working (see below) ... i've upgraded to 3 version as well as updated server to use PHP 7.0 thus not sure if either upgrades are issue ..??.. in looking at the PHP error logs, it seems to be complaing about getAll ... and thus wondering if frm_entry->getAll was deprecated ..??..
thanks - chuck scott
code that used to work:
/* CS – delete ads older than 60 days */
function delete_old_ads(){
global $frm_entry, $frm_entry_meta;
$old_date = (time() - (60 * 24 * 60 * 60));
$entries = $frm_entry->getAll("it.form_id=11");
foreach ($entries as $entry){
$frm_date = $frm_entry_meta->get_entry_meta_by_field($entry->id, 175, true);
if(strtotime($frm_date) < $old_date)
$frm_entry->destroy( $entry->id );
}
}
February 8, 2018 at 12:01 pm
It sounds like those globals were removed in v3. Details in their blog post here.
February 8, 2018 at 1:33 pm
@acasto - Thank You for the link ... apparently both of these are deprecated -> $frm_entry, $frm_entry_meta ...
which leads me to next question, what is the new way to code a line like this ->
global $frm_entry, $frm_entry_meta;
essentially i'm looking to grab all the entries from a form and delete all the entries that are over 60 days old ... thus any pointers you (or others) can share about how to do this in modern 3.0 way is totally appreciated ...
cordially, chuck scott
February 27, 2018 at 3:29 am
Hello, I'm also having a problem with upgrade to 3.0 breaking my code.
require_once( '../../../../wp-load.php' );
global $wpdb,$frm_entry,$frm_entry_meta;
$trainings = $frm_entry->getAll("form_id=12");
......{generates Internal Server Error 500}
Could you please let us know if there is a replacement function for $frm_entry->getAll();
Thanks
-Matthew
Discussion closed.