Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#32 - Add check for empty value #33

Closed

Conversation

dan-westall
Copy link

@dan-westall dan-westall commented Jul 14, 2017

#32 - Prevent the creation of empty meta keys that didn't exist on the copied post, but exist in the whitelist, this wont stop an empty key from being copied.

@@ -134,6 +134,10 @@ public function _wp_save_revisioned_meta_fields( $revision_id ) {
foreach ( $this->_wp_post_revision_meta_keys() as $meta_key ) {
$meta_value = get_post_meta( $post_id, $meta_key );

if ( empty( $meta_value ) ) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if someone clears meta, we need to save that state in a revision, this would prevent that.

Copy link
Owner

@adamsilverstein adamsilverstein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work as is, we actually need to save blank values. We could make this an optional feature with a filter.

@dan-westall
Copy link
Author

Hey @adamsilverstein forgot this was open, created this with the original ticket. I'll close this for now, untill i get a change to add the filter but thanks for taking a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants