turn int|float */ public static function filter_number( $value ) { return filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ); } /** * Sanitize RGBA colors * * @static * @since 0.8.5 * @param string $value The value to be sanitized. * @return string */ public static function rgba( $value ) { $color = \ariColor::newColor( $value ); return $color->toCSS( 'rgba' ); } /** * Sanitize colors. * * @static * @since 0.8.5 * @param string $value The value to be sanitized. * @return string */ public static function color( $value ) { // If the value is empty, then return empty. if ( '' === $value ) { return ''; } // If transparent, then return 'transparent'. if ( is_string( $value ) && 'transparent' === trim( $value ) ) { return 'transparent'; } // Instantiate the object. $color = \ariColor::newColor( $value ); // Return a CSS value, using the auto-detected mode. return $color->toCSS( $color->mode ); } /** * DOES NOT SANITIZE ANYTHING. * * @static * @since 0.5 * @param int|string|array $value The value to be sanitized. * @return int|string|array */ public static function unfiltered( $value ) { return $value; } }