xwp / wp-customize-snapshots

Customize Snapshots WordPress Plugin
https://wordpress.org/plugins/customize-snapshots/
53 stars 16 forks source link

Release 0.6.0 #130

Closed westonruter closed 7 years ago

westonruter commented 7 years ago

pbpaste | sed "s/$PREV_NEW/$NEXT_NEW/g" | sed "s/$PREV_OLD/$PREV_NEW/g" | sed 's:\[x:\[ :' | pbcopy

westonruter commented 7 years ago

I was testing this and I came across something unexpected in relation to deleting settings out of a changeset. What I did was:

  1. Modify title, tagline, and site icon.
  2. Supply a title for the changeset in the Customizer.
  3. Click the icon to inspect the changeset in the admin.
  4. Delete the change to the blogname and hit Save Draft.
  5. The result was the post_content got wiped out. ⚠️
  6. Then I tried editing the changeset in the Customizer, but when I tried to save a draft I got a fatal error due to an oversight which is patched in https://core.trac.wordpress.org/ticket/41252
westonruter commented 7 years ago

I can't seem to reproduce that anymore.

Another issue I am seeing now. When I publish a changeset from the edit post screen, I then get:

You can’t edit this item because it is in the Trash. Please restore it and try again.

westonruter commented 7 years ago

I see. I was testing on a WP Engine install and revisions are disabled on their platform. That means that changesets don't get prevented from being transitioned to the trash status.

westonruter commented 7 years ago

Workaround we can add for WPEngine:

add_filter( 'wp_revisions_to_keep', function( $num, $post ) {
    if ( 'customize_changeset' === $post->post_type && 0 === $num ) {
        $num = 1;
    }
    return $num;
}, 10, 2 );
PatelUtkarsh commented 7 years ago

Bump tested up to?