创建自定义帖子类型创建帖子类型页面
$page = get_page_by_path(\'buyer-order-request\');
if (!$page) {
$buyer_order_requ= \'[buyer_order_request]\';
$post = array(
\'comment_status\' => \'closed\',
\'ping_status\' => \'closed\' ,
\'post_author\' => 1,
\'post_content\' => $buyer_order_requ,
\'post_date\' => date(\'Y-m-d H:i:s\'),
\'post_name\' => \'buyer-order-request\',
\'post_status\' => \'publish\' ,
\'post_title\' => \'Buyer Order Request\',
\'post_type\' => \'page\',
);
//insert page and save the id
$newvalue = wp_insert_post( $post, false );
//save the id in the database
update_option( \'buyerorder_page\', $newvalue );
}