WP insert post PHP function and Custom Fields

Posted by Prem Tiwari | Updated on

If you read the documentation for wp_insert_post, it returns the post ID of the post you just created.

If you combine that with the following function __update_post_meta (a custom function I acquired from this site and adapted a bit)

You’ll get the following:

If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers