2017-02-02 12 views

答えて

0

perticualrフック中にページを追加する場合は、以下のコードを使用できます。

$page_id = wp_insert_post( 
         array( 
          'post_title'  => 'Page Title', 
          'post_name'  => 'Page Title', 
          'post_content' => 'Page Content', 
          'post_status' => 'publish', 
          'post_author' => 1, // or "1" (super-admin?) 
          'post_type'  => 'page', 
          'menu_order'  => 1, 
          'comment_status' => 'closed', 
          'ping_status' => 'closed', 
         ) 
        ); 
関連する問題