diff --git a/classes/class-security.php b/classes/class-security.php index f12b1f93..4851f78b 100644 --- a/classes/class-security.php +++ b/classes/class-security.php @@ -222,7 +222,15 @@ public static function sanitize_selector( $attribute, $control ) { */ if ( empty( $control['value_callback'] ) && - ! isset( $control['options'][ $attribute ] ) + ! isset( $control['options'][ $attribute ] ) && + ( + // Additional check for bool and values 'true', 'false'. + ! is_bool( $attribute ) || + ( + is_bool( $attribute ) && + ! isset( $control['options'][ $attribute ? 'true' : 'false' ] ) + ) + ) ) { $attribute = self::reset_control_attribute_to_default( $attribute, $control ); }