-
Notifications
You must be signed in to change notification settings - Fork 17
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
feat: first pass at enforcing image dimensions #867
base: develop
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
* @return int | ||
*/ | ||
protected function get_image_by_url( $url ) { | ||
if ( function_exists( '\wpcom_vip_url_to_postid' ) ) { |
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.
@nicholasio I had to change it to wpcom_vip_attachment_url_to_postid instead to make it work
📦 Next.js Bundle Analysis for @10up/headstartwpThis analysis was generated by the Next.js Bundle Analysis action. 🤖 This PR introduced no changes to the JavaScript bundle! 🙌 |
$doc = new \WP_HTML_Tag_Processor( $block_content ); | ||
|
||
if ( $doc->next_tag( 'img' ) ) { | ||
$src = $doc->get_attribute( 'src' ); |
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.
@nicholasio maybe worth checking here if it has width and heigh attributes already to bail early. As if in the case something else added it before this hook runs
Description of the Change
Closes #
How to test the Change
Changelog Entry
Credits
Props @username, @username2, ...
Checklist: