Make WordPress Core

Opened 10 months ago

Closed 8 months ago

Last modified 8 months ago

#60847 closed enhancement (fixed)

Style Engine: continue get_classnames loop after adding the default classname

Reported by: ramonopoly's profile ramonopoly Owned by: audrasjb's profile audrasjb
Milestone: 6.6 Priority: normal
Severity: normal Version: 6.6
Component: Editor Keywords: has-patch gutenberg-merge commit
Focuses: Cc:

Description

The WP_Style_Engine class has a method get_classnames that builds classnames.

It loops over an array to add each classname.

There should be a continue in the loop after adding the default classname.

Syncs changes from:

https://github.com/WordPress/gutenberg/pull/60153

Why?

Because we've added the first classname by virtue of testing for true. The following tests all expect a string: get_slug_from_preset_value only works on a string, not a boolean.

Change History (9)

This ticket was mentioned in PR #6323 on WordPress/wordpress-develop by @ramonopoly.


10 months ago
#1

Quick janitorial PR that continues the get_classnames loop after adding the default classname.

Syncs changes from:

## Why?

Because we've added the classname by virtue of testing for true, and besides the subsequent get_slug_from_preset_value only works on a string, not a boolean.

#2 @ramonopoly
8 months ago

  • Milestone changed from Awaiting Review to 6.6
  • Version changed from 6.5 to trunk

This ticket was mentioned in Slack in #core by oglekler. View the logs.


8 months ago

#4 @oglekler
8 months ago

Hi @ramonopoly, we have just a few days before Beta 1, but the patch is very small, so, it still can go into 6.6. Do we even need testing? Thank you!

#5 @ramonopoly
8 months ago

Hi @ramonopoly, we have just a few days before Beta 1, but the patch is very small, so, it still can go into 6.6. Do we even need testing? Thank you!

Thanks for the ping @oglekler

I think this patch is safe - it's been in Gutenberg for a number of versions (probably at least 4-6 months), and tested pretty thoroughly.

It's a small optimization so it would be good, however it if it doesn't make it into 6.6 it's not a huge deal.

Would be nice though :)

Cheers!

#6 @audrasjb
8 months ago

  • Keywords commit added
  • Owner set to audrasjb
  • Status changed from new to accepted

Self assigning for review and commit consideration.

#7 @audrasjb
8 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 58311:

Editor: Style Engine - continue get_classnames loop after adding the default classname.

The WP_Style_Engine class has a method get_classnames that builds classnames. It loops over an array to add each classname. This changeset adds a continue in the loop after adding the default classname.

Syncs changes from https://github.com/WordPress/gutenberg/pull/60153

Props ramonopoly.
Fixes #60847.

#9 @ramonopoly
8 months ago

Thank you for committing!

Note: See TracTickets for help on using tickets.