wp_insert_post() doesnt create revision (2 posts)

  1. essha
    Posted 2 years ago #

    Creating a new post via backend inserts additional a revision at table wp_posts with same date.
    But creating via wp_insert_post() does not.

    What is the correct way to add a post programmatically?

  2. Rajan V
    Posted 2 years ago #

    Hi essha.,

    wp_insert_post() does not create any revision because its new post it does not need to create revision. Revision means backup of existing one.

    You can use <?php wp_update_post( $post ); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.