diff --git a/blocks/donation-form-grid/class-give-donation-form-grid-block.php b/blocks/donation-form-grid/class-give-donation-form-grid-block.php index 7b772dd66f..fc289a528b 100644 --- a/blocks/donation-form-grid/class-give-donation-form-grid-block.php +++ b/blocks/donation-form-grid/class-give-donation-form-grid-block.php @@ -205,11 +205,12 @@ public function register_block() { * @return string; */ public function render_block( $attributes ) { + $ids = $this->getAsArray($attributes['formIDs']); + array_walk($ids, '_give_redirect_form_id'); + $parameters = array( 'forms_per_page' => absint( $attributes['formsPerPage'] ), - 'ids' => implode(',', - array_map('_give_redirect_form_id', $this->getAsArray($attributes['formIDs'])) - ), + 'ids' => implode(',', $ids), 'exclude' => implode(',', $this->getAsArray($attributes['excludedFormIDs'] ) ), 'orderby' => $attributes['orderBy'], 'order' => $attributes['order'], diff --git a/blocks/donor-wall/class-give-donor-wall.php b/blocks/donor-wall/class-give-donor-wall.php index cf2748e52b..80db342802 100644 --- a/blocks/donor-wall/class-give-donor-wall.php +++ b/blocks/donor-wall/class-give-donor-wall.php @@ -206,12 +206,12 @@ public function register_block() { */ public function render_block( $attributes ) { $avatarSize = absint( $attributes['avatarSize'] ); + $ids = $this->getAsArray($attributes['formID']); + array_walk($ids, '_give_redirect_form_id'); $parameters = [ 'donors_per_page' => absint( $attributes['donorsPerPage'] ), - 'form_id' => implode(',', - array_map('_give_redirect_form_id', $this->getAsArray($attributes['formID'])) - ), + 'form_id' => implode(',', $ids), 'ids' => implode(',', $this->getAsArray($attributes['ids'] ) ), 'cats' => implode(',', $this->getAsArray($attributes['categories'] ) ), 'tags' => implode(',', $this->getAsArray($attributes['tags'] ) ), diff --git a/includes/shortcodes.php b/includes/shortcodes.php index d707c0a83f..5b2262d48c 100644 --- a/includes/shortcodes.php +++ b/includes/shortcodes.php @@ -901,7 +901,9 @@ function give_form_grid_shortcode( $atts ) { // Maybe filter forms by IDs. if ( ! empty( $atts['ids'] ) ) { - $form_args['post__in'] = array_map('_give_redirect_form_id', array_filter( array_map( 'trim', explode( ',', $atts['ids'] ) ) ) ); + $ids = array_filter(array_map('trim', explode(',', $atts['ids']))); + array_walk($ids, '_give_redirect_form_id'); + $form_args['post__in'] = $ids; } // Convert comma-separated form IDs into array. diff --git a/src/MultiFormGoals/MultiFormGoal/Shortcode.php b/src/MultiFormGoals/MultiFormGoal/Shortcode.php index f3b2ddce89..c9500311c2 100644 --- a/src/MultiFormGoals/MultiFormGoal/Shortcode.php +++ b/src/MultiFormGoals/MultiFormGoal/Shortcode.php @@ -47,9 +47,11 @@ public function renderCallback($attributes) 'give_multi_form_goal' ); + array_walk($attributes['ids'], '_give_redirect_form_id'); + $multiFormGoal = new MultiFormGoal( [ - 'ids' => array_map('_give_redirect_form_id', $attributes['ids']), + 'ids' => $attributes['ids'], 'tags' => $attributes['tags'], 'categories' => $attributes['categories'], 'goal' => $attributes['goal'], diff --git a/src/MultiFormGoals/ProgressBar/Block.php b/src/MultiFormGoals/ProgressBar/Block.php index 1911e60a6e..45666f6d6a 100644 --- a/src/MultiFormGoals/ProgressBar/Block.php +++ b/src/MultiFormGoals/ProgressBar/Block.php @@ -56,9 +56,11 @@ public function addBlock() **/ public function renderCallback($attributes) { + array_walk($attributes['ids'], '_give_redirect_form_id'); + $progressBar = new ProgressBar( [ - 'ids' => array_map('_give_redirect_form_id', $attributes['ids']), + 'ids' => $attributes['ids'], 'tags' => $attributes['tags'], 'categories' => $attributes['categories'], 'goal' => $attributes['goal'],