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

WordPress Trac noreply at wordpress.org
Thu Dec 25 11:09:01 UTC 2025


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

 * keywords:  has-patch has-unit-tests =>


Comment:

 To achieve the ideal fix, the scope is a little larger than originally
 planned, but [https://github.com/WordPress/wordpress-develop/pull/10663 PR
 10663] does the following:

 - Move the `get_block_wrapper_attirbutes()` function from `wp-includes
 /class-wp-block-supports.php` to `wp-includes/blocks.php` because it is
 unnatural for the function to be in a class file.
 - I noticed that there are no unit tests for the
 `get_block_wrapper_attirbutes()` function itself. This time, I only tested
 the zero value, but maybe we should test attribute merging in the future.
 - Not only the `get_block_wrapper_attirbutes()` function but also
 `apply_block_support()` method was corrected.

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


More information about the wp-trac mailing list