Skip to content

Add dominant color styling before any existing inline style attributes#716

Merged
mukeshpanchal27 merged 4 commits intotrunkfrom
fix/658-inline-style-issue
Apr 21, 2023
Merged

Add dominant color styling before any existing inline style attributes#716
mukeshpanchal27 merged 4 commits intotrunkfrom
fix/658-inline-style-issue

Conversation

@mukeshpanchal27
Copy link
Copy Markdown
Member

@mukeshpanchal27 mukeshpanchal27 commented Apr 20, 2023

Summary

To replicate the issue follow below steps:

  • Go to Admin Panel then add new post
  • Upload featured image for the post
  • Add Cover block in which use "Use featured image" for image
  • Select "FOCAL POINT PICKER"
  • Check frontend.

Before the patch:
Screenshot 2023-04-20 at 2 37 17 PM

After the patch:
Screenshot 2023-04-20 at 2 36 49 PM

Initially i also think about to use str_ends_with but it will create problem when someone add style with space i.e.display: block; then it give false result.

Fixes #658

Checklist

  • PR has either [Focus] or Infrastructure label.
  • PR has a [Type] label.
  • PR has a milestone or the no milestone label.
@mukeshpanchal27 mukeshpanchal27 added [Type] Bug An existing feature is broken [Focus] Images no milestone PRs that do not have a defined milestone for release [Plugin] Image Placeholders Issues for the Image Placeholders plugin (formerly Dominant Color Images) labels Apr 20, 2023
@mukeshpanchal27 mukeshpanchal27 marked this pull request as ready for review April 20, 2023 09:17
Comment on lines 62 to 64
if ( empty( $attr['style'] ) ) {
$attr['style'] = '';
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe we should get rid of this..

Copy link
Copy Markdown
Member

@spacedmonkey spacedmonkey left a comment

Choose a reason for hiding this comment

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

Some simple feedback, but otherwise, looking good.

Copy link
Copy Markdown
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.

@mukeshpanchal27 Almost LGTM, except for what @spacedmonkey already pointed out.

@felixarntz
Copy link
Copy Markdown
Member

@mukeshpanchal27 Since this is a bug fix that has product side implications, we should add a milestone to the issue. no milestone should be reserved only for PRs which don't affect the end user-facing product (e.g. non-functional changes).

@felixarntz felixarntz added this to the 2.3.0 milestone Apr 20, 2023
@felixarntz felixarntz removed the no milestone PRs that do not have a defined milestone for release label Apr 20, 2023
@joemcgill
Copy link
Copy Markdown
Member

Nothing additional from me. Thanks for adding a new unit test for this as well!

mukeshpanchal27 and others added 2 commits April 21, 2023 10:03
Co-authored-by: Jonny Harris <spacedmonkey@users.noreply.github.com>
@mukeshpanchal27
Copy link
Copy Markdown
Member Author

Thanks to all for the feedback. PR is ready for the second round of review.

Copy link
Copy Markdown
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.

@mukeshpanchal27 mukeshpanchal27 merged commit 4474124 into trunk Apr 21, 2023
@mukeshpanchal27 mukeshpanchal27 deleted the fix/658-inline-style-issue branch April 21, 2023 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Plugin] Image Placeholders Issues for the Image Placeholders plugin (formerly Dominant Color Images) [Type] Bug An existing feature is broken

5 participants