[wp-trac] [WordPress Trac] #56810: Wrong doc for block_editor_rest_api_preload()

WordPress Trac noreply at wordpress.org
Wed Oct 12 14:05:25 UTC 2022


#56810: Wrong doc for block_editor_rest_api_preload()
--------------------------+-----------------------------
 Reporter:  Chouby        |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:  5.8
 Severity:  normal        |   Keywords:
  Focuses:  docs          |
--------------------------+-----------------------------
 According to the doc, the function `block_editor_rest_api_preload()` is
 expecting an array of strings as first parameter.

 It's however not true whent the method request is `OPTIONS`. In this
 specific case, the preloaded path is an array itself and the path is the
 first element (index 0) of this array. See for example
 [https://github.com/WordPress/WordPress/blob/6.0.2/wp-admin/edit-form-
 blocks.php#L55-L75 this usage] of the function
 `block_editor_rest_api_preload()`.

 The same mistake is done for the filter
 `block_editor_rest_api_preload_paths` and the deprecated filter
 `block_editor_preload_paths`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56810>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list