From be09f3be5795ea58fd4d9ce82700e543f2924eba Mon Sep 17 00:00:00 2001 From: Aaron Jorbin <622599+aaronjorbin@users.noreply.github.com> Date: Wed, 19 Feb 2025 14:31:34 -0400 Subject: [PATCH] Restore typehint but make it nullable We can still get the benefit of the type hint by making it nullable instead of removing it all together. This will work down to php7.1 which is below the minimum WP version. See https://3v4l.org/1Mdrl for the deprecation and https://3v4l.org/o764l for the nullable version Originally added in https://core.trac.wordpress.org/changeset/59838 Removed in https://core.trac.wordpress.org/changeset/59839 Trac Ticket: https://core.trac.wordpress.org/ticket/62716 --- src/wp-includes/blocks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/blocks.php b/src/wp-includes/blocks.php index 58e03d015585c..f5431e29f0751 100644 --- a/src/wp-includes/blocks.php +++ b/src/wp-includes/blocks.php @@ -1160,7 +1160,7 @@ function apply_block_hooks_to_content( $content, $context = null, $callback = 'i * Default: 'insert_hooked_blocks'. * @return string The serialized markup. */ -function apply_block_hooks_to_content_from_post_object( $content, $post = null, $callback = 'insert_hooked_blocks' ) { +function apply_block_hooks_to_content_from_post_object( $content, ?WP_Post $post = null, $callback = 'insert_hooked_blocks' ) { // Default to the current post if no context is provided. if ( null === $post ) { $post = get_post();