Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action('cred_save_data', 'my_save_content',10,2);
- function my_save_content($post_id, $form_data)
- {
- // if a specific form
- if ($form_data['id']==123)
- {
- if (isset($_POST['post_content_substitute']))
- {
- // add it to saved post meta
- $my_post = array(
- 'ID' => $post_id,
- 'post_content' => $_POST['post_content_substitute']
- );
- // Update the post into the database
- wp_update_post( $my_post );
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement