[wp-trac] [WordPress Trac] #51461: Update WordPress packages

WordPress Trac noreply at wordpress.org
Thu Oct 15 03:08:56 UTC 2020


#51461: Update WordPress packages
-----------------------------------+-------------------------------
 Reporter:  isabel_brison          |       Owner:  jorgefilipecosta
     Type:  enhancement            |      Status:  closed
 Priority:  normal                 |   Milestone:  5.6
Component:  Editor                 |     Version:
 Severity:  normal                 |  Resolution:  fixed
 Keywords:  2nd-opinion has-patch  |     Focuses:
-----------------------------------+-------------------------------

Comment (by dd32):

 Just wanted to note that the new `wp_array_get()` function seems.. weird,
 and I'm not entirely sure it's worth treating as a publicly available
 function, perhaps it should be marked internal-use? or skipped entirely?

 In all cases, it's being used without making use of it's sub-array
 functionality, mostly replacing code similar to this:
 {{{
 isset( $block->supports['field'] ) ? $block->supports['field'] : false
 }}}

 In a PHP7+ world, `wp_array_get( $block->supports, 'field', false )` could
 be replaced with `$block->supports['field'] ?? false`

 There's also an edge oddity around null values (that while not used in
 core, might present in others usage of it) such that `wp_array_get( [
 'key' => null ], 'key', true )` returns `true` as the key isn't considered
 set in the input. Perhaps that would be thought of as expected behaviour.

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


More information about the wp-trac mailing list