[wp-trac] [WordPress Trac] #20299: Preview changes on a published post makes all post meta "live"
WordPress Trac
noreply at wordpress.org
Mon Jan 12 18:32:12 UTC 2015
#20299: Preview changes on a published post makes all post meta "live"
-------------------------------------------------+-------------------------
Reporter: jakemgold | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future
Component: Revisions | Release
Severity: major | Version: 3.3.1
Keywords: editorial-flow has-patch needs- | Resolution:
testing dev-feedback | Focuses:
-------------------------------------------------+-------------------------
Changes (by adamsilverstein):
* keywords: editorial-flow has-patch needs-testing => editorial-flow has-
patch needs-testing dev-feedback
Comment:
Notes on [attachment:20299-3.patch]:
* First take, feedback welcome!
* Requires the [https://wordpress.org/plugins/wp-post-meta-revisions/ wp-
post-meta-revisioning] plugin
* Changes wp_updating_autosave to wp_creating_autosave when creating
autosave
* Adds wp_updating_autosave when actually updating autosave
* Sets DOING_PREVIEW so plugins know not to save meta on previews
* Includes revisioned meta field values as part of autosaves (expects key
name to match element ID)
* Localises the list of revisioned meta keys so autosave.js knows which
fields to add to the autosave
* When doing preview, uses the autosave revisioned post meta
* Includes a unit test verifying the fix, uses an include to pull in the
wp-post-meta-revisions plugin
Testing:
* You can test the current patch using this
[https://github.com/adamsilverstein/background-meta/blob/master
/background-meta.php simple plugin]; set the theme to twenty-fifteen and
choose a background color. Changing and previewing you will nee the new
color, but the original post will remain unaffected. Notes: checks
[https://github.com/adamsilverstein/background-meta/blob/master
/background-meta.php#L135 DOING_PREVIEW] to avoid saving meta during
preview; uses the `wp_post_revision_meta_keys` filter to
[https://github.com/adamsilverstein/background-meta/blob/master
/background-meta.php#L25 speciy meta for revisioning]
--
Ticket URL: <https://core.trac.wordpress.org/ticket/20299#comment:47>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list