Exemple #1
0
 function update_post($entry_id, $form_id)
 {
     if (!isset($_POST['frm_wp_post'])) {
         return;
     }
     $post_id = FrmProEntriesHelper::get_field('post_id', $entry_id);
     if ($post_id) {
         $post = get_post($post_id, ARRAY_A);
         unset($post['post_content']);
         $this->insert_post($entry_id, $post, true, $form_id);
     } else {
         $this->create_post($entry_id, $form_id);
     }
 }
 public static function remove_draft_hooks($entry_id)
 {
     if (!FrmProEntriesHelper::get_field('is_draft', $entry_id)) {
         return;
     }
     //remove hooks if saving as draft
     remove_action('frm_after_create_entry', 'FrmProEntriesController::set_cookie', 20, 2);
     remove_action('frm_after_create_entry', 'FrmProEntriesController::create_post', 40, 2);
     remove_action('frm_after_create_entry', 'FrmProNotification::entry_created', 41, 2);
     remove_action('frm_after_create_entry', 'FrmProNotification::autoresponder', 41, 2);
 }
 public static function remove_draft_hooks($entry_id)
 {
     if (!FrmProEntriesHelper::get_field('is_draft', $entry_id)) {
         return;
     }
     // don't let sub entries remove these hooks
     $entry = FrmEntry::getOne($entry_id);
     if ($entry->parent_item_id) {
         return;
     }
     //remove hooks if saving as draft
     remove_action('frm_after_create_entry', 'FrmProEntriesController::set_cookie', 20);
     remove_action('frm_after_create_entry', 'FrmFormActionsController::trigger_create_actions', 20);
 }
Exemple #4
0
 public static function get_field($field = 'is_draft', $id)
 {
     _deprecated_function(__FUNCTION__, '2.0', 'FrmProEntriesHelper::get_field');
     return FrmProEntriesHelper::get_field($field, $id);
 }