WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/15/2016 09:02:38 AM (3 years ago)
Author:
westonruter
Message:

Customize: Allow starter content to apply in a new theme when switching from another theme containing changes.

  • Ensure that starter content can apply from theme B after previewing starter content in theme A.
  • Introduce new starter_content flag in changeset setting params which is used to capture whether a value is starter content and thus can be overridden.
  • Create changeset up-front with starter_content flags instead of waiting for AUTOSAVE_INTERVAL.
  • Eliminate instantiation of settings for widget instances in favor of directly calling sanitize_widget_js_instance. This eliminates issues with looking for widgets before they are registered.
  • Ensure that non-placeholders (inline arrays instead of string references) can be supplied in starter content.
  • Re-use auto-draft posts as starter content across theme switches.
  • Introduce starter_content param for WP_Customize_Manager::save_changeset_post() which is false except when starter content is being loaded on a fresh_site.

See #38114.
Fixes #38541.

File:
1 edited

Legend:

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

    r39138 r39241  
    697697        $this->manager->add_setting( new WP_Customize_Filter_Setting( $this->manager, 'nav_menus_created_posts', array(
    698698            'transport' => 'postMessage',
     699            'type' => 'option', // To prevent theme prefix in changeset.
    699700            'default' => array(),
    700701            'sanitize_callback' => array( $this, 'sanitize_nav_menus_created_posts' ),
Note: See TracChangeset for help on using the changeset viewer.