From 639e5575d6aedb3c44c4083e31b5b7baab5c0d14 Mon Sep 17 00:00:00 2001 From: Faisal Ahammad Date: Thu, 30 Jul 2026 17:48:16 +0600 Subject: [PATCH] fix(block-migrate): remove unnecessary pass-by-reference on WP_Post WP_Post is an object, already passed by handle to closures. The & on the the_post callback parameter was redundant and triggers a PHP 8.x warning because WP_Hook::apply_filters() passes arguments by value. Fixes #2662 --- includes/block-migrate/loader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/block-migrate/loader.php b/includes/block-migrate/loader.php index d783bce4e97..c5de2a985d2 100644 --- a/includes/block-migrate/loader.php +++ b/includes/block-migrate/loader.php @@ -26,7 +26,7 @@ */ add_action( 'the_post', - function( WP_Post &$post ) { + function( WP_Post $post ) { if ( ! function_exists( 'is_admin' ) || ! function_exists( 'get_current_screen' ) || is_null( get_current_screen() ) ) { return; }