diff --git a/classes/class-security.php b/classes/class-security.php index b0290714..f45b093e 100644 --- a/classes/class-security.php +++ b/classes/class-security.php @@ -218,8 +218,14 @@ public static function sanitize_boolean( $attribute ) { public static function sanitize_selector( $attribute, $control ) { /** * Checking a selector for invalid options. + * Exclude multiple and dynamically callback selectors. */ - if ( ! array_key_exists( $attribute, $control['options'] ) ) { + if ( + empty( $control['value_callback'] ) && + ! empty( $control['options'] ) && + ! $control['multiple'] && + ! array_key_exists( $attribute, $control['options'] ) + ) { $attribute = $control['default'] ?? ''; }