Skip to content

Commit

Permalink
Blocks: Document Block Hooks functions as private.
Browse files Browse the repository at this point in the history
Documents the 4 new 6.4 Block Hooks global functions as private and for Core-only internal usage:

* `make_before_block_visitor()`
* `make_after_block_visitor()`
* `traverse_and_serialize_block()`
* `traverse_and_serialize_blocks()`

This is being done as the architectural design of these new functions may change in the next cycle. Further denoting them as private / Core only can help to avoid extender churn if any of these functions are deprecated.

Follow up to [56649], [56620].

Props azaozz, hellofromTonya, bernhard-reiter, gziolo, mikeschroder.
Fixes #59783.
See #59313.
Built from https://develop.svn.wordpress.org/trunk@57066


git-svn-id: http://core.svn.wordpress.org/trunk@56577 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
hellofromtonya committed Nov 6, 2023
1 parent 747b2c9 commit faa928f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions wp-includes/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,8 @@ function get_hooked_blocks() {
* where it will inject the `theme` attribute into all Template Part blocks, and prepend the markup for
* any blocks hooked `before` the given block and as its parent's `first_child`, respectively.
*
* This function is meant for internal use only.
*
* @since 6.4.0
* @access private
*
Expand Down Expand Up @@ -838,6 +840,8 @@ function make_before_block_visitor( $hooked_blocks, $context ) {
* where it will append the markup for any blocks hooked `after` the given block and as its parent's
* `last_child`, respectively.
*
* This function is meant for internal use only.
*
* @since 6.4.0
* @access private
*
Expand Down Expand Up @@ -1035,7 +1039,10 @@ function serialize_blocks( $blocks ) {
* This function should be used when there is a need to modify the saved block, or to inject markup
* into the return value. Prefer `serialize_block` when preparing a block to be saved to post content.
*
* This function is meant for internal use only.
*
* @since 6.4.0
* @access private
*
* @see serialize_block()
*
Expand Down Expand Up @@ -1117,7 +1124,10 @@ function traverse_and_serialize_block( $block, $pre_callback = null, $post_callb
* This function should be used when there is a need to modify the saved blocks, or to inject markup
* into the return value. Prefer `serialize_blocks` when preparing blocks to be saved to post content.
*
* This function is meant for internal use only.
*
* @since 6.4.0
* @access private
*
* @see serialize_blocks()
*
Expand Down
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.5-alpha-57065';
$wp_version = '6.5-alpha-57066';

/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
Expand Down

0 comments on commit faa928f

Please sign in to comment.