From cd8044a9de1b902edb0a17334a0fa5ff9ee08d27 Mon Sep 17 00:00:00 2001 From: abaicus Date: Thu, 8 Dec 2022 16:39:57 +0200 Subject: [PATCH] chore: adds starter content [closes #18] --- inc/Core.php | 3 ++ inc/Starter_Content.php | 67 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+) create mode 100644 inc/Starter_Content.php diff --git a/inc/Core.php b/inc/Core.php index 666109f..9aee36a 100644 --- a/inc/Core.php +++ b/inc/Core.php @@ -65,6 +65,9 @@ private function run_hooks() { public function setup() { load_theme_textdomain( 'raft', RAFT_DIR . '/languages' ); + $starter_content = new Starter_Content(); + + add_theme_support( 'starter-content', $starter_content->get() ); add_theme_support( 'wp-block-styles' ); add_theme_support( 'automatic-feed-links' ); add_theme_support( 'title-tag' ); diff --git a/inc/Starter_Content.php b/inc/Starter_Content.php new file mode 100644 index 0000000..8723130 --- /dev/null +++ b/inc/Starter_Content.php @@ -0,0 +1,67 @@ + array( + 'primary' => array( + 'items' => array( + 'home' => array( + 'type' => 'post_type', + 'object' => 'page', + 'object_id' => '{{' . self::HOME_SLUG . '}}', + ), + 'page_blog' => array( + 'type' => 'post_type', + 'object' => 'page', + 'object_id' => '{{' . self::BLOG_SLUG . '}}', + ), + ), + ), + ), + 'options' => array( + 'page_on_front' => '{{' . self::HOME_SLUG . '}}', + 'page_for_posts' => '{{' . self::BLOG_SLUG . '}}', + 'show_on_front' => 'page', + ), + 'posts' => array( + self::BLOG_SLUG => array( + 'post_name' => self::BLOG_SLUG, + 'post_type' => 'page', + 'post_title' => self::BLOG_SLUG, + ), + self::HOME_SLUG => array( + 'post_type' => 'page', + 'post_title' => self::HOME_SLUG, + 'post_content' => ' + +

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore.

+ + ', + ), + ), + ); + } +}