WordPress.org

Make WordPress Core


Ignore:
Timestamp:
09/27/2017 10:24:37 PM (4 years ago)
Author:
westonruter
Message:

Customize: Introduce drafting and scheduling for Customizer changesets.

  • Incorporates code from the Customize Snapshots and Customize Posts feature plugins.
  • Adds a new Publish Settings section for managing the changeset status, scheduled date, and frontend preview link.
  • Updates Publish button to reflect the status selected in the Publish Settings (including Save Draft and Schedule).
  • Deactivates the Themes section when a non-publish status selected, and deactivates the Publish Settings section when previewing a theme switch.
  • Introduces an outer section type (wp.customize.OuterSection in JS) for the Publish Settings section to use and for available widgets and available nav menu panels to use in the future. These sections can be expanded while other sections are expanded.
  • Introduces WP_Customize_Date_Time_Control in PHP and wp.customize.DateTimeControl in JS for managing a date/time value.
  • Keeps track of scheduled time and proactively publish from the client when the time arrives, as opposed to waiting for WP Cron.
  • Auto-publishes a scheduled changeset when attempting to access one that missed its schedule.
  • Starts a new changeset if attempting to save a changeset that was previously publish.
  • Adds force arg to requestChangesetUpdate() to force an update request even when there are no pending changes.
  • Adds utils methods for getCurrentTimestamp and getRemainingTime.
  • Adds new state values for selectedChangesetStatus, changesetDate, selectedChangesetDate.
  • Fixes logic for when to short-circuit check to close Customizer when there are unsaved changes.
  • Adds getter methods for autosaved and branching parameters, with the latter applying the customize_changeset_branching filter.
  • Call to establish_loaded_changeset on the fly when changeset_uuid() is called if no changeset UUID was specififed.
  • De-duplicates logic for dismissing auto-draft changesets.
  • Includes unit tests.

Builds on [41597].
Props sayedwp, westonruter, melchoyce, JoshuaWold, folletto, stubgo, karmatosed, dlh, paaljoachim, afercia, johnregan3, utkarshpatel, valendesigns.
See #30937.
Fixes #39896, #28721, #39275.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/script-loader.php

    r41608 r41626  
    548548    $scripts->add( 'customize-controls', "/wp-admin/js/customize-controls$suffix.js", array( 'customize-base', 'wp-a11y', 'wp-util' ), false, 1 );
    549549    did_action( 'init' ) && $scripts->localize( 'customize-controls', '_wpCustomizeControlsL10n', array(
    550         'activate'           => __( 'Save & Activate' ),
    551         'save'               => __( 'Save & Publish' ),
     550        'activate'           => __( 'Activate & Publish' ),
     551        'save'               => __( 'Save & Publish' ), // @todo Remove as not required.
     552        'publish'            => __( 'Publish' ),
     553        'published'          => __( 'Published' ),
     554        'saveDraft'          => __( 'Save Draft' ),
     555        'draftSaved'         => __( 'Draft Saved' ),
     556        'updating'           => __( 'Updating' ),
     557        'schedule'           => __( 'Schedule' ),
     558        'scheduled'          => __( 'Scheduled' ),
     559        'invalid'            => __( 'Invalid' ),
     560        'saveBeforeShare'    => __( 'Please save your changes in order to share the preview.' ),
     561        'futureDateError'    => __( 'You must supply a future date to schedule.' ),
    552562        'saveAlert'          => __( 'The changes you made will be lost if you navigate away from this page.' ),
    553563        'saved'              => __( 'Saved' ),
     
    564574        /* translators: placeholder is URL to the Customizer to load the autosaved version */
    565575        'autosaveNotice'     => __( 'There is a more recent autosave of your changes than the one you are previewing. <a href="%s">Restore the autosave</a>' ),
    566         'videoHeaderNotice'   => __( 'This theme doesn\'t support video headers on this page. Navigate to the front page or another page that supports video headers.' ),
     576        'videoHeaderNotice'  => __( 'This theme doesn\'t support video headers on this page. Navigate to the front page or another page that supports video headers.' ),
    567577        // Used for overriding the file types allowed in plupload.
    568578        'allowedFiles'       => __( 'Allowed Files' ),
Note: See TracChangeset for help on using the changeset viewer.