Make WordPress Core

Ticket #42395: 42395.3.diff

File 42395.3.diff, 1.1 KB (added by westonruter, 4 years ago)
  • src/wp-includes/class-wp-customize-manager.php

    diff --git src/wp-includes/class-wp-customize-manager.php src/wp-includes/class-wp-customize-manager.php
    index 12256d2173..351e62995f 100644
    final class WP_Customize_Manager { 
    11751175
    11761176                $changeset_data = array();
    11771177                if ( $this->changeset_post_id() ) {
     1178
     1179                        /*
     1180                         * Don't re-import starter content into a changeset saved persistently.
     1181                         * This will need to be revisited in the future once theme switching
     1182                         * is allowed with drafted/scheduled changesets, since switching to
     1183                         * another theme could result in more starter content being applied.
     1184                         * However, when doing an explicit save it is currently possible for
     1185                         * nav menus and nav menu items specifically to lose their starter_content
     1186                         * flags, thus resulting in duplicates being created since they fail
     1187                         * to get re-used. See #40146.
     1188                         */
     1189                        if ( 'auto-draft' !== get_post_status( $this->changeset_post_id() ) ) {
     1190                                return;
     1191                        }
     1192
    11781193                        $changeset_data = $this->get_changeset_post_data( $this->changeset_post_id() );
    11791194                }
    11801195