WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/23/2016 09:52:27 AM (5 years ago)
Author:
helen
Message:

Theme starter content: Add support for featured images and page templates.

Featured image support means that attachments can now be imported. Media can be sideloaded from within theme or plugin directories. Like other posts, attachments are auto-drafts until customizer changes are published, and are not duplicated when they already exist in the customized state. Attachment IDs can be used for any number of purposes, much like post IDs. Twenty Seventeen now includes 3 images used as featured images to best showcase the multi-section homepage setup.

As featured image IDs are stored in post meta, it also made sense to add support for page templates. Twenty Seventeen does not include any such templates, but the functionality can be quite important for displaying themes to their best effect.

props westonruter, helen, flixos90.
fixes #38615.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-nav-menus.php

    r39241 r39346  
    11921192        if ( ! empty( $post_ids ) ) {
    11931193            foreach ( $post_ids as $post_id ) {
     1194                $target_status = 'attachment' === get_post_type( $post_id ) ? 'inherit' : 'publish';
     1195
    11941196                // Note that wp_publish_post() cannot be used because unique slugs need to be assigned.
    1195                 wp_update_post( array( 'ID' => $post_id, 'post_status' => 'publish' ) );
     1197                wp_update_post( array( 'ID' => $post_id, 'post_status' => $target_status ) );
    11961198            }
    11971199        }
Note: See TracChangeset for help on using the changeset viewer.