Skip to content

From ticket patch#2409

Draft
adamsilverstein wants to merge 44 commits intoWordPress:trunkfrom
adamsilverstein:ticket/53232
Draft

From ticket patch#2409
adamsilverstein wants to merge 44 commits intoWordPress:trunkfrom
adamsilverstein:ticket/53232

Conversation

@adamsilverstein
Copy link
Member

Trac ticket: https://core.trac.wordpress.org/ticket/53232


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

adamsilverstein and others added 3 commits March 16, 2022 08:30
Co-authored-by: Crisoforo Gaspar Hernández <hello@crisoforo.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
Copy link
Member

@mitogh mitogh left a comment

Choose a reason for hiding this comment

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

Looks great 💯

Copy link
Member

@westonruter westonruter left a comment

Choose a reason for hiding this comment

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

These suggestions should fix the tests now that the $context argument is required by wp_img_tag_add_decoding_async_attr().

adamsilverstein and others added 3 commits March 29, 2022 09:05
Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
Co-authored-by: Weston Ruter <westonruter@google.com>
adamsilverstein and others added 5 commits March 29, 2022 16:02
Co-authored-by: Tonya Mork <tonya.mork@automattic.com>
Co-authored-by: Tonya Mork <tonya.mork@automattic.com>
# Conflicts:
#	src/wp-includes/media.php
@adamsilverstein adamsilverstein force-pushed the ticket/53232 branch 2 times, most recently from 9a2d84b to 79b931c Compare April 12, 2022 16:44
Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

@adamsilverstein This looks great. Just one thing that needs to be changed (decoding attribute has to be added before the wp_content_img_tag filter), plus two minor suggestions.

Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

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

My review is basically "what Felix said" with the addition of a change request in wp_get_attachment_image()

Thanks for your work implementing the new functions and extending the API, I really appreciate it.

Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

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

@adamsilverstein Production code now lgtm, however note that PHPUnit tests around this are failing, e.g. https://github.com/WordPress/wordpress-develop/runs/6040566464?check_suite_focus=true.

Looks like that's mostly about the ordering of the attributes being added, so you probably just need to fix the tests.

'force_display' => false,
'loading' => null,
'extra_attr' => '',
'decoding' => 'async',
Copy link
Contributor

@costdev costdev Apr 19, 2022

Choose a reason for hiding this comment

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

Should this be added below 'loading' instead of below 'extra_attr'?

Confidence check me on this: As these are run through wp_parse_args(), this shouldn't introduce a BC break, right?

Copy link
Contributor

Choose a reason for hiding this comment

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

Confidence check me on this: As these are run through wp_parse_args(), this shouldn't introduce a BC break, right?

That's correct.

If a developer is defining their own decoding attribute in the function call, that will trump the one that is defined here.

peterwilsoncc and others added 2 commits June 9, 2022 14:49
Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
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.

8 participants