[wp-trac] [WordPress Trac] #59783: Block Hooks: Mark and document publicly available global functions as being Core-only internal functions.

WordPress Trac noreply at wordpress.org
Wed Nov 1 13:54:33 UTC 2023


#59783: Block Hooks: Mark and document publicly available global functions as being
Core-only internal functions.
----------------------------+-------------------------
 Reporter:  hellofromTonya  |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  6.4
Component:  Editor          |    Version:  trunk
 Severity:  normal          |   Keywords:  needs-patch
  Focuses:  docs            |
----------------------------+-------------------------
 This ticket is a follow-up to the
 [https://wordpress.slack.com/archives/C02RQBWTW/p1698842841389459
 discussion in Make/Core slack core channel today].

 [https://wordpress.slack.com/archives/C02RQBWTW/p1698845408174839 For my
 assessment] which @bernhard-reiter confirmed
 >For now, seems the code is not intended for extensibility, but rather is
 a low-level internal Core only functionality.

 The new functions, such as `traverse_and_serialize_blocks()` et all, are
 low-level Core-only functionality that should not be used outside of Core.

 It's too late in the 6.4 cycle for an architectural redesign to "hide"
 (encapsulate) the internal functionality (though will be considered in a
 follow-up ticket for a future release).

 For new functions that are not currently denoted as Core-only, such as
 `traverse_and_serialize_blocks()`,
 [https://wordpress.slack.com/archives/C02RQBWTW/p1698845884018929 this
 ticket proposes]:

 * Marking them with `@access private`.
 * Adding an explanation to the DocBlock to better document they are
 intended for Core only usage.
 * Consider renaming with the private `_` prefix to further denote these
 are for Core only.

 Note: Core-only includes further iteration and refinement in Gutenberg,
 which will come to Core.

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


More information about the wp-trac mailing list