diff --git a/give.php b/give.php index 61f79765a7..8cc9b7f5e1 100644 --- a/give.php +++ b/give.php @@ -6,7 +6,7 @@ * Description: The most robust, flexible, and intuitive way to accept donations on WordPress. * Author: GiveWP * Author URI: https://givewp.com/ - * Version: 3.0.2 + * Version: 3.0.3 * Requires at least: 6.0 * Requires PHP: 7.2 * Text Domain: give @@ -391,7 +391,7 @@ private function setup_constants() { // Plugin version. if (!defined('GIVE_VERSION')) { - define('GIVE_VERSION', '3.0.2'); + define('GIVE_VERSION', '3.0.3'); } // Plugin Root File. diff --git a/readme.txt b/readme.txt index a3ad65a791..a8de6b6aa4 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: donation, donate, recurring donations, fundraising, crowdfunding Requires at least: 6.0 Tested up to: 6.4 Requires PHP: 7.2 -Stable tag: 3.0.2 +Stable tag: 3.0.3 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl-3.0.html @@ -262,6 +262,9 @@ The 2% fee on Stripe donations only applies to donations taken via our free Stri 10. Use almost any payment gateway integration with GiveWP through our add-ons or by creating your own add-on. == Changelog == += 3.0.3: October 20th, 2023 = +* Fix: Using the multi-form shortcode with the ids attribute no longer causes a fatal error + = 3.0.2: October 19th, 2023 = * Fix: Stripe per-form settings are included when migrating a form to the Visual Donation Form Builder * Fix: Gateways are properly separated in the settings page and Global Settings for Fee Recovery shows all gateways when you select per gateway diff --git a/src/MultiFormGoals/MultiFormGoal/Shortcode.php b/src/MultiFormGoals/MultiFormGoal/Shortcode.php index f3b2ddce89..e3a12f35be 100644 --- a/src/MultiFormGoals/MultiFormGoal/Shortcode.php +++ b/src/MultiFormGoals/MultiFormGoal/Shortcode.php @@ -26,6 +26,7 @@ public function addShortcode() /** * Returns Shortcode markup * + * @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) @@ -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'], diff --git a/src/MultiFormGoals/ProgressBar/Model.php b/src/MultiFormGoals/ProgressBar/Model.php index de4f7a1bf5..22b1b87db2 100644 --- a/src/MultiFormGoals/ProgressBar/Model.php +++ b/src/MultiFormGoals/ProgressBar/Model.php @@ -38,6 +38,7 @@ public function __construct(array $args) /** * Get forms associated with Progress Bar * + * @since 3.0.3 Return empty array instead of false * @since 2.9.0 */ public function getForms(): array @@ -78,7 +79,7 @@ public function getForms(): array return $query->posts; } else { - return false; + return []; } }