[wp-trac] [WordPress Trac] #59622: Block supports: Avoid warning for non string class attributes

WordPress Trac noreply at wordpress.org
Wed Sep 10 20:26:03 UTC 2025


#59622: Block supports: Avoid warning for non string class attributes
--------------------------------------+-----------------------------
 Reporter:  dmsnell                   |       Owner:  dmsnell
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  Future Release
Component:  Editor                    |     Version:  6.4
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+-----------------------------
Changes (by dmsnell):

 * owner:  (none) => dmsnell
 * status:  new => closed
 * resolution:   => fixed


Comment:

 In [changeset:"60727" 60727]:
 {{{
 #!CommitTicketReference repository="" revision="60727"
 Block Supports: Avoid throwing warning when checking for class attribute
 as string.

 When encountering HTML tags with boolean or missing tags, the
 get_attribute() method in the HTML API returns true and null,
 respectively. If these returned values are sent directly into string
 comparison functions then as of PHP 8.0 they will throw E_DEPRECATED
 errors.

 In this patch, block supports is enhanced to check that the class value is
 a string before it performs string operations on it.

 Also in this patch: using `assertEqualHTML()` in background support test
 instead of `assertSame()`

 Developed in https://github.com/WordPress/wordpress-develop/pull/5486
 Discussed in https://core.trac.wordpress.org/ticket/59622

 Props dmsnell, jonsurrell, hellofromtonya, peterwilsoncc.
 Fixes #59622.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59622#comment:17>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list