From ae8288cbaa8ef1f5cd7c7408dec337e3a32e2997 Mon Sep 17 00:00:00 2001 From: hellofromTonya Date: Mon, 6 Nov 2023 15:29:17 +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]. 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 --- 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 74b20fae90..34ff3a2cfd 100644 --- a/wp-includes/blocks.php +++ b/wp-includes/blocks.php @@ -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 * 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 * @@ -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 * `last_child`, respectively. * + * This function is meant for internal use only. + * * @since 6.4.0 * @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 * 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() * @@ -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 * 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 e44ca064ba..4b478d4f01 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @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.