wp_update_post updates more than expected
-
I’m struggling to understand some confusing behavior with wp_update_post: a direct copy/paste of content completely corrupts a bunch of Gutenberg plugins.
Example:
// Get original post $my_post = get_post(POST_ID); $my_post_content = $my_post->post_content; // Copy the content and update the post with the same content $copy_post = array(); $copy_post['ID'] =POST_ID; $copy_post['post_content'] = $my_post_content; wp_update_post($copy_post);
If you do the above on a post that has a PostX Post Grid, for example, the PostX grids on the page will all be corrupted and broken. But I’m not sure why copying and pasting the post content should change anything.
What am I missing? Thanks!
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘wp_update_post updates more than expected’ is closed to new replies.