maxworkingwell

CRED expiration_update

Oct 29th, 2021 (edited)
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1. add_action('cred_submit_complete', 'expiration_update',10,2);
  2. function expiration_update($post_id, $form_data)
  3. {
  4.  
  5.     // if a specific form
  6.     if ($form_data['id']==19)
  7.     {
  8.      $new_date = get_post_meta($post_id, 'wpcf-date-of-home-purchase', true);
  9.  
  10.     //We update the _cred_post_expiration_time Field in the Database with this new value
  11.      update_post_meta($post_id, '_cred_post_expiration_time', $new_date);
  12.  
  13.     }
  14. }
Add Comment
Please, Sign In to add comment