From 922300455927801d5fdc83f734afd3cb04be57f3 Mon Sep 17 00:00:00 2001 From: Md Mazharul Islam <54615735+csemazharul@users.noreply.github.com> Date: Sat, 22 Aug 2026 00:53:04 +0600 Subject: [PATCH] Administration: Pass $count to the second _list_meta_row() call. [61224] renamed $c to $count in wp_ajax_add_meta(), but only two of the three occurrences were updated. The _list_meta_row() call in the branch that updates existing meta still passes $c, which is no longer defined anywhere in the function. _list_meta_row() takes its second argument by reference, so PHP creates the variable rather than emitting an undefined variable warning. That is also why static analysis does not catch it: $c is absent from tests/phpstan/baselines/variable.undefined.neon even though five other variables in this file are listed there. Nothing reads $count after either call, so there is no change in output. Co-Authored-By: Claude Opus 5 --- src/wp-admin/includes/ajax-actions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-admin/includes/ajax-actions.php b/src/wp-admin/includes/ajax-actions.php index c51751940a976..d1616661ce7e1 100644 --- a/src/wp-admin/includes/ajax-actions.php +++ b/src/wp-admin/includes/ajax-actions.php @@ -1747,7 +1747,7 @@ function wp_ajax_add_meta() { 'meta_value' => $value, 'meta_id' => $meta_id, ), - $c + $count ), 'position' => 0, 'supplemental' => array( 'postid' => $meta->post_id ),