WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/17/2017 08:14:56 PM (4 years ago)
Author:
westonruter
Message:

Customize: Allow post/page stubs to be edited in WP Admin as "customization drafts" when changeset is saved as draft or scheduled.

  • Update stubs to have draft status when changeset is saved as draft, instead of preventing auto-draft garbage collection by giving them a far-future post_date.
  • Show notice in publish metabox when editing a customization draft indicating that it will be published automatically with its changeset; a link to Customizer is included.
  • Include a new "Customization Draft" display post state in the post list table.
  • Disconnect stubs from their changesets when they are updated with a status other than "Draft".
  • Trash customization drafts when their related changeset is trashed or deleted.
  • Add a _customize_changeset_uuid postmeta to stubs to link them with their associated changeset.
  • Include customize_changeset_uuid as context when requesting to insert a new auto-draft.

Props westonruter, melchoyce.
See #39896, #39752, #34923.
Fixes #42220.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/meta-boxes.php

    r41763 r41887  
    222222    </fieldset>
    223223</div><?php // /misc-pub-section ?>
     224<?php endif; ?>
     225
     226<?php if ( 'draft' === $post->post_status && get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ) : ?>
     227    <div class="notice notice-info notice-alt inline">
     228        <p>
     229            <?php
     230            echo sprintf(
     231                /* translators: %s is the URL to the Customizer */
     232                __( 'This draft comes from your <a href="%s">unpublished customization changes</a>. You can edit, but there&#8217;s no need to publish now. It will be published automatically with those changes.' ),
     233                esc_url(
     234                    add_query_arg(
     235                        'changeset_uuid',
     236                        rawurlencode( get_post_meta( $post->ID, '_customize_changeset_uuid', true ) ),
     237                        admin_url( 'customize.php' )
     238                    )
     239                )
     240            );
     241            ?>
     242        </p>
     243    </div>
    224244<?php endif; ?>
    225245
Note: See TracChangeset for help on using the changeset viewer.