Adding Plugin-specific Fields with wp_insert_post()?
(Moderator's note: The original title was "wp_insert_post() and plugins")
I use wp_insert_post()
like this:
$my_post = array(
'post_title' = 'title',
'post_content' = $post,
'post_status' = 'publish',
'post_author' = 1,
'post_date' = date('Y-m-d H:i:s', $oldtime),
'post_category' = array(3,4)
);
wp_insert_post( $my_post );
Everything works fine, but I want to use plugins like "All in One SEO Pack" I can't figure out how to save their custom fields. I tried this but it did not work:
$my_post = array(
'post_title' = 'title',
'post_content' = $post,
'post_status' = 'publish',
'post_author' = 1,
'post_date' = date('Y-m-d H:i:s', $oldtime),
'post_category' = array(3,4)
'aiosp_description' = 'description',
'aiosp_keywords' = 'keywords' // these (aiosp_) is from post edit page in WP (input type="text" size="62" name="aiosp_keywords" value="keywords")
);
wp_insert_post( $my_post );
How can I save these fields? Thanks for any help!!!
Topic plugin-all-in-one-seo posts plugins Wordpress
Category Web