This repository was archived by the owner on Dec 16, 2022. It is now read-only.
Fix handling of postmeta preview filter when no modifications are in customized state#309
Merged
westonruter merged 1 commit intodevelopfrom Oct 18, 2016
Merged
Conversation
Member
Author
|
@westonruter not sure if this is a correct solution so feel free to amend or close this PR. |
westonruter
reviewed
Oct 18, 2016
| if ( $can_preview ) { | ||
| $value = $postmeta_setting->post_value(); | ||
| } else { | ||
| return null; |
Contributor
There was a problem hiding this comment.
I think this makes sense, because the filter is originally invoked with null:
$check = apply_filters( "get_{$meta_type}_metadata", null, $object_id, $meta_key, $single );Also, the null !== $value check is done above to “Abort if another filter has already short-circuited.” So we know at this point that $value is null, so this could either return null like you're doing here or return $value.
westonruter
referenced
this pull request
Oct 18, 2016
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Return null if can not preview customize postmeta setting
Issue discussion 0df94bb#commitcomment-19463405