Support » How-To and Troubleshooting » wp_update_post() not working

wp_update_post() not working

  • I want to update post content via third party plugin but it don’t work for me I don’t know why. My code is:

    $new_content = array(
    ‘ID’ => $post_id,
    ‘post_content’ => $article

    wp_update_post( $new_content );

    This code is inside function which is inside a class

Viewing 1 replies (of 1 total)
  • Where do you define $post_id?

    Also, the problem looks to be that you don’t have enough info in the $new_content array, I’d recommend looking at the defaults specified in the source for wp_update_post.

Viewing 1 replies (of 1 total)
  • The topic ‘wp_update_post() not working’ is closed to new replies.