[wp-trac] [WordPress Trac] #56307: Docs: Fix parameter type of `$feature` in `block_has_support()`

WordPress Trac noreply at wordpress.org
Fri Jul 29 13:59:23 UTC 2022


#56307: Docs: Fix parameter type of `$feature` in `block_has_support()`
--------------------------+------------------------------
 Reporter:  Soean         |       Owner:  audrasjb
     Type:  defect (bug)  |      Status:  accepted
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Editor        |     Version:  5.8
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:  docs
--------------------------+------------------------------

Comment (by Soean):

 Only one $feature is checked at a time, this $feature can be nested, like
 for example:

 **block.json**
 {{{

 {
     "apiVersion": 2,
     ...
     "supports": {
         "spacing": {
             "margin": true,
             "padding": false
         }
         "align": false
     }
 }

 }}}



 `$feature`:
 `array( 'spacing', 'margin' )` --> `true`

 `array( 'spacing', 'padding' )` --> `false`

 Or be at the highest level, like:

 `array( 'align' )` --> `false`

 So maybe? `Array of path to a specific feature to check support for.` ?

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


More information about the wp-trac mailing list