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.
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
Back up edited
full
image sources when restoring the original image #314Back up edited
full
image sources when restoring the original image #314Changes from 1 commit
ff1616a
ee8d1cb
577ea64
10e09b7
8cfb0e4
e1e0368
d64771e
d00cb2f
178cdba
849c6fd
File filter
Filter by extension
Conversations
Jump to
IMAGE_EDIT_OVERWRITE
constant.There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have the same question as Felix and would like to explore that edge case.
I tried this edge case in which the
_wp_attachment_backup_sources
meta value is null or not an array. As per the below code snippet, it will initialize an empty array for$backup_sources
.After this snippet, we have another snippet that checks two things if
full-orig
key is not set in array$backup_sources
or it's not an array.In this edge case the function return
$data
so as I understood it is worth initializing an empty array instead of returning the$data
as pervious it does.Please let me know if I'm getting anything wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can tell it doesn't really matter though which way to go about this line of code, for the following reason:
$backup_sources
is not an array, the following condition! isset( $backup_sources['full-orig'] ) || ! is_array( $backup_sources['full-orig'] )
will also fore sure evaluate tofalse
.$backup_sources
as empty array, causing$data
to be returned in the following clause, or we can return$data
right away. I don't think it changes the function behavior at all honestly.cc @mitogh