I have been trying to update a post in the posts table but for some reason, it is creating a multiple number of revisions but not updating the main post. I have been trying hard for the last one day to figure this out but so far so luck with this.
$post_meta_value = get_post_meta($unit_post_id, $post_meta_key.'_after_id', true); global $wpdb; $my_post = array( 'ID' => $post_meta_value, 'post_content' => $meta_after_content, 'post_title' => $meta_after_title, 'post_status' => 'publish' ); wp_update_post($my_post); // Update the post into the database
I have looked at the codex, but I am confused about the action mentioned in the code http://codex.wordpress.org/Function_Reference/wp_update_post