Last active
May 30, 2023 14:09
-
-
Save 1844144/6683f8c5faf91ea4b43cf32bc569b509 to your computer and use it in GitHub Desktop.
Formidable Forms: Create Entry, Update metas for existing entry
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
<? | |
$arg = array( | |
'form_id' => $opts['subscription_form'], | |
'item_key' => FrmAppHelper::get_unique_key( | |
'', $pre . 'frm_items', 'item_key', 0 ), | |
'item_meta' => array( | |
$opts['subscription_id'] => $payment->response->getSubscriptionId(), | |
$opts['subscription_pre_payment_id'] => $payment->entry->id, | |
$opts['subscription_date'] => $metas[$opts['recur_date']], | |
$opts['subscription_amount'] => $metas[$opts['recur_amount']], | |
$opts['subscription_interval'] => $opts['interval'], | |
$opts['subscription_interval_count'] => $opts['interval_count'], | |
), | |
); | |
FrmEntry::create($arg); |
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 | |
$fields = FrmField::get_all_for_form($form_id); |
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
<? | |
global $wpdb; | |
$pre = $wpdb->prefix; | |
$pledge_entry = FrmEntry::getOne($pledge_entry_id, true); | |
$metas = $pledge_entry->metas; | |
$metas[1038] = $total; | |
$metas[1040] = $balance; | |
$metas[1016] = $status; | |
FrmEntryMeta::update_entry_metas($pledge_entry_id, $metas); | |
$time = current_time('mysql',1); | |
$sql="UPDATE {$pre}frm_items set updated_at='$time' where id={$pledge_entry_id}"; | |
$wpdb->query($sql); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment