Make WordPress Core

Ticket #39109: 39109.2.patch

File 39109.2.patch, 3.2 KB (added by ocean90, 8 years ago)
  • src/wp-content/themes/twentyseventeen/functions.php

     
    106106         */
    107107        add_editor_style( array( 'assets/css/editor-style.css', twentyseventeen_fonts_url() ) );
    108108
    109         add_theme_support( 'starter-content', array(
     109        // Define and register starter content to showcase the theme on new sites.
     110        $starter_content = array(
    110111                'widgets' => array(
     112                        // Place three core-defined widgets in the sidebar area.
    111113                        'sidebar-1' => array(
    112114                                'text_business_info',
    113115                                'search',
     
    114116                                'text_about',
    115117                        ),
    116118
     119                        // Add the core-defined business info widget to the footer 1 area.
    117120                        'sidebar-2' => array(
    118121                                'text_business_info',
    119122                        ),
    120123
     124                        // Put two core-defined widgets in the footer 2 area.
    121125                        'sidebar-3' => array(
    122126                                'text_about',
    123127                                'search',
     
    124128                        ),
    125129                ),
    126130
     131                // Specify the core-defined pages to create and add custom thumbnails to some of them.
    127132                'posts' => array(
    128133                        'home',
    129134                        'about' => array(
     
    140145                        ),
    141146                ),
    142147
     148                // Create the custom image attachments used as post thumbnails for pages.
    143149                'attachments' => array(
    144150                        'image-espresso' => array(
    145151                                'post_title' => _x( 'Espresso', 'Theme starter content', 'twentyseventeen' ),
    146                                 'file' => 'assets/images/espresso.jpg',
     152                                'file' => 'assets/images/espresso.jpg', // URL relative to the template directory.
    147153                        ),
    148154                        'image-sandwich' => array(
    149155                                'post_title' => _x( 'Sandwich', 'Theme starter content', 'twentyseventeen' ),
     
    155161                        ),
    156162                ),
    157163
     164                // Default to a static front page and assign the front and posts pages.
    158165                'options' => array(
    159166                        'show_on_front' => 'page',
    160167                        'page_on_front' => '{{home}}',
     
    161168                        'page_for_posts' => '{{blog}}',
    162169                ),
    163170
     171                // Set the front page section theme mods to the IDs of the core-registered pages.
    164172                'theme_mods' => array(
    165173                        'panel_1' => '{{homepage-section}}',
    166174                        'panel_2' => '{{about}}',
     
    168176                        'panel_4' => '{{contact}}',
    169177                ),
    170178
     179                // Set up nav menus for each of the two areas registered in the theme.
    171180                'nav_menus' => array(
     181                        // Assign a menu to the "top" location.
    172182                        'top' => array(
    173183                                'name' => __( 'Top Menu', 'twentyseventeen' ),
    174184                                'items' => array(
    175                                         'link_home',
     185                                        'link_home', // Note that the core "home" page is actually a link in case a static front page is not used.
    176186                                        'page_about',
    177187                                        'page_blog',
    178188                                        'page_contact',
    179189                                ),
    180190                        ),
     191
     192                        // Assign a menu to the "social" location.
    181193                        'social' => array(
    182194                                'name' => __( 'Social Links Menu', 'twentyseventeen' ),
    183195                                'items' => array(
     
    189201                                ),
    190202                        ),
    191203                ),
    192         ) );
     204        );
     205
     206        /**
     207         * Filters Twenty Seventeen array of starter content.
     208         *
     209         * @since Twenty Seventeen 1.1
     210         *
     211         * @param array $starter_content Array of starter content.
     212         */
     213        $starter_content = apply_filters( 'twentyseventeen_starter_content', $starter_content );
     214
     215        add_theme_support( 'starter-content', $starter_content );
    193216}
    194217add_action( 'after_setup_theme', 'twentyseventeen_setup' );
    195218