WP insert, post PHP function and Custom Fields

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:


Leave a reply