Skip to content

Commit

Permalink
fix notice
Browse files Browse the repository at this point in the history
  • Loading branch information
tobeyadr committed Jan 2, 2025
1 parent bd7548b commit b64d5fb
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions includes/form/form-v2.php
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,17 @@ function standard_dropdown_callback( $field, $posted_data, &$data, &$meta, &$tag
* @return void
*/
function standard_multiselect_callback( $field, $posted_data, &$data, &$meta, &$tags ) {
$selections = map_deep( $posted_data[ $field['name'] ], 'sanitize_text_field' );
$meta[ $field['name'] ] = $selections;

$options = $field['options'];
$selections = get_array_var( $posted_data, $field['name'], [] );

if ( ! is_array( $selections ) ) {
return;
}

$selections = map_deep( array_filter( $selections ), 'sanitize_text_field' );

$meta[ $field['name'] ] = $selections;
$options = $field['options'];

// Find associated tags and apply
foreach ( $selections as $selection ) {
Expand Down

0 comments on commit b64d5fb

Please sign in to comment.