SHARE
TWEET

Untitled

shelob9 Nov 9th, 2017 128 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Save PDF link of entry, as user as user meta
  3.  */
  4. add_action( 'caldera_forms_submit_complete', function( $form, $referrer, $process_id, $entry_id ) {
  5.     //change your form ID here
  6.     if( 'cf123..' != $form[ 'ID' ] ) {
  7.         return;
  8.     }
  9.  
  10.     $message = \calderawp\calderaforms\pro\container::get_instance()->get_messages_db()->get_by_entry_id( $entry_id );
  11.     if( ! is_wp_error( $message ) ) {
  12.         $link = $message->get_pdf_link();
  13.         update_user_meta( get_current_user_id(), '_last_entry_pdf', $link );
  14.     }
  15.    
  16. }, 10, 4 );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top