$my_post = array(
'post_title' => $publication_name,
'post_excerpt' => $publication_name,
'post_date' => '2019-04-30 09:00:00',
'post_date_gmt' => '2019-04-30 09:00:00',
'post_content' => $publication_name,
'post_status' => 'publish',
'post_author' => 1,
'meta_input' => array(
'publication_name' => $publication_name,
'postal_code' => $postal_code,
'postal_code' => $postal_code,
'frequency' => $frequency,
'issn' => $issn,
'rack_number' => $rack_number
),
'post_category' => array( 15 ) // 文章所在分类 ID
);
$mydata[] = $my_post;
wp_insert_post( $my_post,$wp_error = true);
wordpress 添加自定义字段到 文章
猜你喜欢
转载自blog.csdn.net/james_laughing/article/details/89705567
今日推荐
周排行