From 465f5686ea7d59ea6b26d86044ef9ca11f029314 Mon Sep 17 00:00:00 2001 From: Glauber Silva Date: Fri, 20 Oct 2023 16:14:14 -0300 Subject: [PATCH 1/2] refactor: use static function on array_map callback to pass the id as reference for _give_redirect_form_id to prevent warnings on PHP 8.0.1 or plus --- src/MultiFormGoals/MultiFormGoal/Shortcode.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/MultiFormGoals/MultiFormGoal/Shortcode.php b/src/MultiFormGoals/MultiFormGoal/Shortcode.php index f3b2ddce89..aa8701380a 100644 --- a/src/MultiFormGoals/MultiFormGoal/Shortcode.php +++ b/src/MultiFormGoals/MultiFormGoal/Shortcode.php @@ -26,6 +26,7 @@ public function addShortcode() /** * Returns Shortcode markup * + * @unreleased Use static function on array_map callback to pass the id as reference for _give_redirect_form_id to prevent warnings on PHP 8.0.1 or plus * @since 2.9.0 **/ public function renderCallback($attributes) @@ -49,7 +50,12 @@ public function renderCallback($attributes) $multiFormGoal = new MultiFormGoal( [ - 'ids' => array_map('_give_redirect_form_id', $attributes['ids']), + 'ids' => array_map( + static function ($id) { + _give_redirect_form_id($id); + }, + $attributes['ids'] + ), 'tags' => $attributes['tags'], 'categories' => $attributes['categories'], 'goal' => $attributes['goal'], From 4ed0ba960659efbb9514f572db3432414be9025e Mon Sep 17 00:00:00 2001 From: Angela Blake <35241639+angelablake@users.noreply.github.com> Date: Fri, 20 Oct 2023 17:51:45 -0500 Subject: [PATCH 2/2] chore: prepare for 3.0.3 release again --- src/MultiFormGoals/MultiFormGoal/Shortcode.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MultiFormGoals/MultiFormGoal/Shortcode.php b/src/MultiFormGoals/MultiFormGoal/Shortcode.php index aa8701380a..e3a12f35be 100644 --- a/src/MultiFormGoals/MultiFormGoal/Shortcode.php +++ b/src/MultiFormGoals/MultiFormGoal/Shortcode.php @@ -26,7 +26,7 @@ public function addShortcode() /** * Returns Shortcode markup * - * @unreleased Use static function on array_map callback to pass the id as reference for _give_redirect_form_id to prevent warnings on PHP 8.0.1 or plus + * @since 3.0.3 Use static function on array_map callback to pass the id as reference for _give_redirect_form_id to prevent warnings on PHP 8.0.1 or plus * @since 2.9.0 **/ public function renderCallback($attributes)