-
Notifications
You must be signed in to change notification settings - Fork 109
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
Adds sources information to the attachment media details of the REST response #224
Conversation
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.
Great work on this one, few minor comments/questions.
modules/images/webp-uploads/load.php
Outdated
if ( empty( $metadata['file'] ) ) { | ||
return $response; | ||
} |
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.
Curios about the need for this conditional if the file
key is not accessed in this function.
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.
Just a concise way to ensure that the metadata array contains data that belongs to an image.
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'm not sure if it follow that part, I think this sectionof code is not required due you already have this section in place few lines below:
if ( ! isset( $data['media_details']['sizes'] ) || ! is_array( $data['media_details']['sizes'] ) ) {
Which already covers that scenario.
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 agree that check here looks unnecessary. A more appropriate check if we want to avoid running the following logic unnecessarily may be empty( $metadata['sizes'] )
for example.
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.
@mitogh @felixarntz ok, this check is removed. 👍
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.
@eugene-manuilov Nothing to add from my end other than what @mitogh has already commented on. Other than that, this looks solid 👍
Co-authored-by: Crisoforo Gaspar Hernández <hello@crisoforo.com>
Co-authored-by: Crisoforo Gaspar Hernández <hello@crisoforo.com>
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.
One minor comment, but overall lgtm!
modules/images/webp-uploads/load.php
Outdated
if ( empty( $metadata['file'] ) ) { | ||
return $response; | ||
} |
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 agree that check here looks unnecessary. A more appropriate check if we want to avoid running the following logic unnecessarily may be empty( $metadata['sizes'] )
for example.
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.
👍
Summary
Fixes #167
Relevant technical choices
Checklist
[Focus]
orInfrastructure
label.[Type]
label.no milestone
label.