Blocks: Document Block Hooks functions as private.

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].

Reviewed by karmatosed.
Merges [57066] to the 6.4 branch.

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


git-svn-id: http://core.svn.wordpress.org/branches/6.4@56582 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya 2023-11-06 15:29:17 +00:00
parent b4b177b469
commit ae8288cbaa
2 changed files with 11 additions and 1 deletions

View File

@ -758,6 +758,8 @@ function get_hooked_blocks() {
* where it will inject the `theme` attribute into all Template Part blocks, and prepend the markup for * 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. * 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 * @since 6.4.0
* @access private * @access private
* *
@ -832,6 +834,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 * where it will append the markup for any blocks hooked `after` the given block and as its parent's
* `last_child`, respectively. * `last_child`, respectively.
* *
* This function is meant for internal use only.
*
* @since 6.4.0 * @since 6.4.0
* @access private * @access private
* *
@ -1029,7 +1033,10 @@ function serialize_blocks( $blocks ) {
* This function should be used when there is a need to modify the saved block, or to inject markup * 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. * 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 * @since 6.4.0
* @access private
* *
* @see serialize_block() * @see serialize_block()
* *
@ -1111,7 +1118,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 * 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. * 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 * @since 6.4.0
* @access private
* *
* @see serialize_blocks() * @see serialize_blocks()
* *

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.4-RC3-57070'; $wp_version = '6.4-RC3-57071';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.