Advertisement
deadhead1971

CRED form (toolset). Avoid WYSIWYG editor - use substitute

Aug 6th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1. add_action('cred_save_data', 'my_save_content',10,2);
  2. function my_save_content($post_id, $form_data)
  3. {
  4.     // if a specific form
  5.     if ($form_data['id']==123)
  6.     {
  7.         if (isset($_POST['post_content_substitute']))
  8.         {
  9.             // add it to saved post meta
  10.               $my_post = array(
  11.                   'ID'           => $post_id,
  12.                   'post_content' => $_POST['post_content_substitute']
  13.               );
  14.  
  15.             // Update the post into the database
  16.               wp_update_post( $my_post );
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement