PluginProbe
GiveWP – Donation Plugin and Fundraising Platform / 4.16.9
GiveWP – Donation Plugin and Fundraising Platform v4.16.9
4.16.9 4.16.8.1 4.16.8 4.16.7.2 4.16.7.1 4.16.7 4.16.6.1 4.16.6 4.16.5.1 4.16.5 4.16.4 4.16.3 4.16.2 4.16.1 4.16.0 4.15.5 4.15.4 4.15.3 4.15.2 4.15.1 4.15.0 2.3.0 2.3.1 2.3.2 2.30.0 All 255 releases
← All changes | src/MultiFormGoals/ProgressBar/Block.php +13 -2 2.30.04.16.9 View file →
@@ -51,8 +51,9 @@
51 51
52 52 /**
53 53 * Returns Progress Bar block markup
54 54 *
55 + * @since 3.1.0 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
55 56 * @since 2.9.0
56 57 **/
57 58 public function renderCallback($attributes)
58 59 {
@@ -57,9 +58,16 @@
57 58 public function renderCallback($attributes)
58 59 {
59 60 $progressBar = new ProgressBar(
60 61 [
61 - 'ids' => $attributes['ids'],
62 + 'ids' => array_map(
63 + static function ($id) {
64 + _give_redirect_form_id($id);
65 +
66 + return $id;
67 + },
68 + $attributes['ids']
69 + ),
62 70 'tags' => $attributes['tags'],
63 71 'categories' => $attributes['categories'],
64 72 'goal' => $attributes['goal'],
65 73 'enddate' => $attributes['enddate'],
@@ -98,13 +106,16 @@
98 106 'color' => '#777777',
99 107 ],
100 108 ];
101 109 $editorColorPalette = get_theme_support('editor-color-palette'); // Return value is in a nested array.
110 +
102 111 wp_localize_script(
103 112 'give-blocks-js',
104 113 'giveProgressBarThemeSupport',
105 114 [
106 - 'editorColorPalette' => $editorColorPalette ? array_shift($editorColorPalette) : $defaultColorPalette,
115 + 'editorColorPalette' => is_array($editorColorPalette) ? array_shift(
116 + $editorColorPalette
117 + ) : $defaultColorPalette,
107 118 ]
108 119 );
109 120 }
110 121 }