[wp-trac] [WordPress Trac] #64452: get_block_wrapper_attributes() function strips falsy values like zero

WordPress Trac noreply at wordpress.org
Tue Jun 2 14:57:21 UTC 2026


#64452: get_block_wrapper_attributes() function strips falsy values like zero
--------------------------------------+------------------------------
 Reporter:  wildworks                 |       Owner:  wildworks
     Type:  defect (bug)              |      Status:  closed
 Priority:  normal                    |   Milestone:  Awaiting Review
Component:  Editor                    |     Version:
 Severity:  normal                    |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests  |     Focuses:
--------------------------------------+------------------------------
Changes (by wildworks):

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


Comment:

 In [changeset:"62450" 62450]:
 {{{
 #!CommitTicketReference repository="" revision="62450"
 Blocks: Preserve zero values in wrapper attributes.

 The string `"0"` and the integer `0` were previously dropped when merging
 block wrapper attributes because falsy values were filtered out. Strings
 and numbers are now kept and cast to a string, so zero values are
 preserved.

 Type annotations and null checks are also improved.

 Props westonruter, wildworks.
 Fixes #64452.
 }}}

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


More information about the wp-trac mailing list