• When a new (post|media|tag|whatever) is added, it’s given an ID. How is this ID determined? Is there a counter somewhere?

Viewing 1 replies (of 1 total)
  • It is the autoincrement ID field of your primary key in the MySQL database.

    You can determine the new post ID if you are programtically inserting a new post by this code:

    $post_id = wp_insert_post( $post, $wp_error );

    Hope this helps.

Viewing 1 replies (of 1 total)
  • The topic ‘How is the post_id determined when adding a new post?’ is closed to new replies.