Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #51461, comment 11


Ignore:
Timestamp:
10/15/2020 03:09:46 AM (4 years ago)
Author:
dd32
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #51461, comment 11

    initial v1  
    66}}}
    77
    8 In a PHP7+ world, `wp_array_get( $block->supports, 'field', false )` could be replaced with `$block->supports['field'] ?? false`
     8In a PHP7+ world, `wp_array_get( $block->supports, 'field', false )` could be replaced with `$block->supports['field'] ?? false` (which seems far easier to read than this function, same as the isset() is easier to understand)
    99
    1010There'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.