Make WordPress Core


Ignore:
Timestamp:
02/21/2017 07:01:07 AM (10 years ago)
Author:
dd32
Message:

Customize: Allow custom post types to be used in starter content.

Changes WP_Customize_Nav_Menus::insert_auto_draft_post() so it can be invoked for a post_type that is not registered (yet).

Props westonruter.
Merges [39924] to the 4.7 branch.
See #38615, #38114.
Fixes #39610.

Location:
branches/4.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.7

  • branches/4.7/src/wp-includes/class-wp-customize-manager.php

    r40095 r40098  
    998998                );
    999999
     1000                /*
     1001                 * Obtain all post types referenced in starter content to use in query.
     1002                 * This is needed because 'any' will not account for post types not yet registered.
     1003                 */
     1004                $post_types = array_filter( array_merge( array( 'attachment' ), wp_list_pluck( $posts, 'post_type' ) ) );
     1005
    10001006                // Re-use auto-draft starter content posts referenced in the current customized state.
    10011007                $existing_starter_content_posts = array();
    … …  
    10041010                                'post__in' => $starter_content_auto_draft_post_ids,
    10051011                                'post_status' => 'auto-draft',
    1006                                 'post_type' => 'any',
     1012                                'post_type' => $post_types,
    10071013                                'posts_per_page' => -1,
    10081014                        ) );
Note: See TracChangeset for help on using the changeset viewer.