[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentytwentyone/inc/ -> starter-content.php (source)

   1  <?php
   2  /**
   3   * Twenty Twenty-One Starter Content
   4   *
   5   * @link https://make.wordpress.org/core/2016/11/30/starter-content-for-themes-in-4-7/
   6   *
   7   * @package WordPress
   8   * @subpackage Twenty_Twenty_One
   9   * @since Twenty Twenty-One 1.0
  10   */
  11  
  12  /**
  13   * Function to return the array of starter content for the theme.
  14   *
  15   * Passes it through the `twenty_twenty_one_starter_content` filter before returning.
  16   *
  17   * @since Twenty Twenty-One 1.0
  18   *
  19   * @return array A filtered array of args for the starter_content.
  20   */
  21  function twenty_twenty_one_get_starter_content() {
  22  
  23      // Define and register starter content to showcase the theme on new sites.
  24      $starter_content = array(
  25  
  26          // Specify the core-defined pages to create and add custom thumbnails to some of them.
  27          'posts'     => array(
  28              'front' => array(
  29                  'post_type'    => 'page',
  30                  'post_title'   => esc_html_x( 'Create your website with blocks', 'Theme starter content', 'twentytwentyone' ),
  31                  'post_content' => '
  32                      <!-- wp:heading {"align":"wide","fontSize":"gigantic","style":{"typography":{"lineHeight":"1.1"}}} -->
  33                      <h2 class="alignwide has-text-align-wide has-gigantic-font-size" style="line-height:1.1">' . esc_html_x( 'Create your website with blocks', 'Theme starter content', 'twentytwentyone' ) . '</h2>
  34                      <!-- /wp:heading -->
  35  
  36                      <!-- wp:spacer -->
  37                      <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
  38                      <!-- /wp:spacer -->
  39  
  40                      <!-- wp:columns {"verticalAlignment":"center","align":"wide","className":"is-style-twentytwentyone-columns-overlap"} -->
  41                      <div class="wp-block-columns alignwide are-vertically-aligned-center is-style-twentytwentyone-columns-overlap"><!-- wp:column {"verticalAlignment":"center"} -->
  42                      <div class="wp-block-column is-vertically-aligned-center"><!-- wp:image {"align":"full","sizeSlug":"large"} -->
  43                      <figure class="wp-block-image alignfull size-large"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/roses-tremieres-hollyhocks-1884.jpg" alt="' . esc_attr__( '&#8220;Roses Trémières&#8221; by Berthe Morisot', 'twentytwentyone' ) . '"/></figure>
  44                      <!-- /wp:image -->
  45  
  46                      <!-- wp:spacer -->
  47                      <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
  48                      <!-- /wp:spacer -->
  49  
  50                      <!-- wp:image {"align":"full","sizeSlug":"large","className":"is-style-twentytwentyone-image-frame"} -->
  51                      <figure class="wp-block-image alignfull size-large is-style-twentytwentyone-image-frame"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/in-the-bois-de-boulogne.jpg" alt="' . esc_attr__( '&#8220;In the Bois de Boulogne&#8221; by Berthe Morisot', 'twentytwentyone' ) . '"/></figure>
  52                      <!-- /wp:image --></div>
  53                      <!-- /wp:column -->
  54  
  55                      <!-- wp:column {"verticalAlignment":"center"} -->
  56                      <div class="wp-block-column is-vertically-aligned-center"><!-- wp:spacer -->
  57                      <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
  58                      <!-- /wp:spacer -->
  59  
  60                      <!-- wp:image {"sizeSlug":"large","className":"alignfull size-full is-style-twentytwentyone-border"} -->
  61                      <figure class="wp-block-image size-large alignfull size-full is-style-twentytwentyone-border"><img src="' . esc_url( get_template_directory_uri() ) . '/assets/images/young-woman-in-mauve.jpg" alt="' . esc_attr__( '&#8220;Young Woman in Mauve&#8221; by Berthe Morisot', 'twentytwentyone' ) . '"/></figure>
  62                      <!-- /wp:image --></div>
  63                      <!-- /wp:column --></div>
  64                      <!-- /wp:columns -->
  65  
  66                      <!-- wp:spacer {"height":50} -->
  67                      <div style="height:50px" aria-hidden="true" class="wp-block-spacer"></div>
  68                      <!-- /wp:spacer -->
  69  
  70                      <!-- wp:columns {"verticalAlignment":"top","align":"wide"} -->
  71                      <div class="wp-block-columns alignwide are-vertically-aligned-top"><!-- wp:column {"verticalAlignment":"top"} -->
  72                      <div class="wp-block-column is-vertically-aligned-top"><!-- wp:heading {"level":3} -->
  73                      <h3>' . esc_html_x( 'Add block patterns', 'Theme starter content', 'twentytwentyone' ) . '</h3>
  74                      <!-- /wp:heading -->
  75  
  76                      <!-- wp:paragraph -->
  77                      <p>' . esc_html_x( 'Block patterns are pre-designed groups of blocks. To add one, select the Add Block button [+] in the toolbar at the top of the editor. Switch to the Patterns tab underneath the search bar, and choose a pattern.', 'Theme starter content', 'twentytwentyone' ) . '</p>
  78                      <!-- /wp:paragraph --></div>
  79                      <!-- /wp:column -->
  80  
  81                      <!-- wp:column {"verticalAlignment":"top"} -->
  82                      <div class="wp-block-column is-vertically-aligned-top"><!-- wp:heading {"level":3} -->
  83                      <h3>' . esc_html_x( 'Frame your images', 'Theme starter content', 'twentytwentyone' ) . '</h3>
  84                      <!-- /wp:heading -->
  85  
  86                      <!-- wp:paragraph -->
  87                      <p>' . esc_html_x( 'Twenty Twenty-One includes stylish borders for your content. With an Image block selected, open the "Styles" panel within the Editor sidebar. Select the "Frame" block style to activate it.', 'Theme starter content', 'twentytwentyone' ) . '</p>
  88                      <!-- /wp:paragraph --></div>
  89                      <!-- /wp:column -->
  90  
  91                      <!-- wp:column {"verticalAlignment":"top"} -->
  92                      <div class="wp-block-column is-vertically-aligned-top"><!-- wp:heading {"level":3} -->
  93                      <h3>' . esc_html_x( 'Overlap columns', 'Theme starter content', 'twentytwentyone' ) . '</h3>
  94                      <!-- /wp:heading -->
  95  
  96                      <!-- wp:paragraph -->
  97                      <p>' . esc_html_x( 'Twenty Twenty-One also includes an overlap style for column blocks. With a Columns block selected, open the "Styles" panel within the Editor sidebar. Choose the "Overlap" block style to try it out.', 'Theme starter content', 'twentytwentyone' ) . '</p>
  98                      <!-- /wp:paragraph --></div>
  99                      <!-- /wp:column --></div>
 100                      <!-- /wp:columns -->
 101  
 102                      <!-- wp:spacer -->
 103                      <div style="height:100px" aria-hidden="true" class="wp-block-spacer"></div>
 104                      <!-- /wp:spacer -->
 105  
 106                      <!-- wp:cover {"overlayColor":"green","contentPosition":"center center","align":"wide","className":"is-style-twentytwentyone-border"} -->
 107                      <div class="wp-block-cover alignwide has-green-background-color has-background-dim is-style-twentytwentyone-border"><div class="wp-block-cover__inner-container"><!-- wp:spacer {"height":20} -->
 108                      <div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>
 109                      <!-- /wp:spacer -->
 110  
 111                      <!-- wp:paragraph {"fontSize":"huge"} -->
 112                      <p class="has-huge-font-size">' . esc_html_x( 'Need help?', 'Theme starter content', 'twentytwentyone' ) . '</p>
 113                      <!-- /wp:paragraph -->
 114  
 115                      <!-- wp:spacer {"height":75} -->
 116                      <div style="height:75px" aria-hidden="true" class="wp-block-spacer"></div>
 117                      <!-- /wp:spacer -->
 118  
 119                      <!-- wp:columns -->
 120                      <div class="wp-block-columns"><!-- wp:column -->
 121                      <div class="wp-block-column"><!-- wp:paragraph -->
 122                      <p><a href="https://wordpress.org/support/article/twenty-twenty-one/">' . esc_html_x( 'Read the Theme Documentation', 'Theme starter content', 'twentytwentyone' ) . '</a></p>
 123                      <!-- /wp:paragraph --></div>
 124                      <!-- /wp:column -->
 125  
 126                      <!-- wp:column -->
 127                      <div class="wp-block-column"><!-- wp:paragraph -->
 128                      <p><a href="https://wordpress.org/support/theme/twentytwentyone/">' . esc_html_x( 'Check out the Support Forums', 'Theme starter content', 'twentytwentyone' ) . '</a></p>
 129                      <!-- /wp:paragraph --></div>
 130                      <!-- /wp:column --></div>
 131                      <!-- /wp:columns -->
 132  
 133                      <!-- wp:spacer {"height":20} -->
 134                      <div style="height:20px" aria-hidden="true" class="wp-block-spacer"></div>
 135                      <!-- /wp:spacer --></div></div>
 136                      <!-- /wp:cover -->',
 137              ),
 138              'about',
 139              'contact',
 140              'blog',
 141          ),
 142  
 143          // Default to a static front page and assign the front and posts pages.
 144          'options'   => array(
 145              'show_on_front'  => 'page',
 146              'page_on_front'  => '{{front}}',
 147              'page_for_posts' => '{{blog}}',
 148          ),
 149  
 150          // Set up nav menus for each of the two areas registered in the theme.
 151          'nav_menus' => array(
 152              // Assign a menu to the "primary" location.
 153              'primary' => array(
 154                  'name'  => esc_html__( 'Primary menu', 'twentytwentyone' ),
 155                  'items' => array(
 156                      'link_home', // Note that the core "home" page is actually a link in case a static front page is not used.
 157                      'page_about',
 158                      'page_blog',
 159                      'page_contact',
 160                  ),
 161              ),
 162  
 163              // Assign a menu to the "footer" location.
 164              'footer'  => array(
 165                  'name'  => esc_html__( 'Secondary menu', 'twentytwentyone' ),
 166                  'items' => array(
 167                      'link_facebook',
 168                      'link_twitter',
 169                      'link_instagram',
 170                      'link_email',
 171                  ),
 172              ),
 173          ),
 174      );
 175  
 176      /**
 177       * Filters the array of starter content.
 178       *
 179       * @since Twenty Twenty-One 1.0
 180       *
 181       * @param array $starter_content Array of starter content.
 182       */
 183      return apply_filters( 'twenty_twenty_one_starter_content', $starter_content );
 184  }


Generated: Sat Jul 24 01:00:05 2021 Cross-referenced by PHPXref 0.7.1