From faa928f218625241a55825267f9105da4f8405e4 Mon Sep 17 00:00:00 2001 From: hellofromTonya Date: Mon, 6 Nov 2023 13:37:24 +0000 Subject: [PATCH] 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]. 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 --- wp-includes/blocks.php | 10 ++++++++++ wp-includes/version.php | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/wp-includes/blocks.php b/wp-includes/blocks.php index d632759b6a..1dc1e66230 100644 --- a/wp-includes/blocks.php +++ b/wp-includes/blocks.php @@ -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 * @@ -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 * @@ -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() * @@ -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() * diff --git a/wp-includes/version.php b/wp-includes/version.php index aeea4ac64c..a0198b2e4e 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.