Inserting post_id into guid before wp_insert_post

Why would you need that? ID in a database is auto increment – it manages it’s value itself. If your target is to set custom guid, you should update the inserted post as soon as it is created via wp_update_post right after your $post_id = wp_inserted_post($mypost); like this: …Your code above… $postid = wp_insert_post($mypost); $data … Read more

GUID URL Question

Background: The guid should be just what the name says: a globally unique identifier. A unique string or number, not related to a public address at all. However, some functions, namely for images, are still using it for URLs. There are plans to fix that somewhere in the future, see #6492. For now, you can … Read more

tech