文件操作 - css-utility.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/jimbrandstatter/public_html/wp-content/themes/Total/inc/functions/css-utility.php
编辑文件内容
<?php /** * Return utility font sizes. */ function wpex_utl_font_sizes(): array { $font_sizes = [ '' => esc_html__( 'Default', 'total' ), 'base' => esc_html__( 'Base (1em)', 'total' ), 'xs' => esc_html__( 'Extra Small', 'total' ), 'sm' => esc_html__( 'Small', 'total' ), 'md' => esc_html__( 'Medium', 'total' ), 'lg' => esc_html__( 'Large', 'total' ), 'xl' => esc_html__( 'x Large', 'total' ), '2xl' => esc_html__( '2x Large', 'total' ), '3xl' => esc_html__( '3x Large', 'total' ), '4xl' => esc_html__( '4x Large', 'total' ), '5xl' => esc_html__( '5x Large', 'total' ), '6xl' => esc_html__( '6x Large', 'total' ), '7xl' => esc_html__( '7x Large', 'total' ), ]; /** * Filters the theme font size options. * * @param array $font_sizes */ $font_sizes = apply_filters( 'wpex_utl_font_sizes', $font_sizes ); return (array) $font_sizes; } /** * Return utility percentage widths. */ function wpex_utl_percent_widths(): array { $widths = [ '' => esc_html__( 'Default', 'total' ), '20' => '20%', '25' => '25%', '30' => '30%', '33' => '33%', '40' => '40%', '50' => '50%', '60' => '60%', '67' => '67%', '70' => '70%', '75' => '75%', '80' => '80%', '100' => '100%', ]; /** * Filters the percent width options. * * @param array $widths */ $widths = apply_filters( 'wpex_utl_precentage_widths', $widths ); return (array) $widths; } /** * Return utility border radius. */ function wpex_utl_border_radius( $include_blobs = false ): array { $choices = [ '' => esc_html__( 'Default', 'total' ), 'rounded-xs' => esc_html__( 'Extra Small', 'total' ), 'rounded-sm' => esc_html__( 'Small', 'total' ), 'rounded' => esc_html__( 'Average', 'total' ), 'rounded-md' => esc_html__( 'Medium', 'total' ), 'rounded-lg' => esc_html__( 'Large', 'total' ), 'rounded-full' => esc_html__( 'Full', 'total' ), 'rounded-0' => esc_html__( 'None', 'total' ), ]; if ( $include_blobs ) { $blobs = array( 'radius-blob-1' => esc_html__( 'Blob 1', 'total' ), 'radius-blob-2' => esc_html__( 'Blob 2', 'total' ), 'radius-blob-3' => esc_html__( 'Blob 3', 'total' ), 'radius-blob-4' => esc_html__( 'Blob 4', 'total' ), 'radius-blob-5' => esc_html__( 'Blob 5', 'total' ), ); $choices = array_merge( $choices, $blobs ); } /** * Filters the border radius choices. * * @param array $choices * @param bool $include_blobs */ $choices = apply_filters( 'wpex_utl_border_radius', $choices, $include_blobs ); return (array) $choices; } /** * Return utility border width types. */ function wpex_utl_border_widths(): array { $widths = [ '' => esc_html__( 'Default', 'total' ), '0px' => '0px', '1' => '1px', '2' => '2px', '3' => '3px', '4' => '4px', ]; /** * Filters the border width options. * * @param array $widths */ $widths = apply_filters( 'wpex_utl_border_widths', $widths ); return (array) $widths; } /** * Return utility paddings. */ function wpex_utl_paddings(): array { $paddings = [ '' => esc_html__( 'Default', 'total' ), '0px' => '0px', '5px' => '5px', '10px' => '10px', '15px' => '15px', '20px' => '20px', '25px' => '25px', '30px' => '30px', '40px' => '40px', '50px' => '50px', ]; /** * Filters the padding options. * * @param array $paddings */ $paddings = apply_filters( 'wpex_utl_paddings', $paddings ); return (array) $paddings; } /** * Return utility margins. */ function wpex_utl_margins(): array { $margins = [ '' => esc_html__( 'Default', 'total' ), '0px' => '0px', '5px' => '5px', '10px' => '10px', '15px' => '15px', '20px' => '20px', '25px' => '25px', '30px' => '30px', '40px' => '40px', '50px' => '50px', '60px' => '60px', ]; /** * Filters the margin options. * * @param array $margins */ $margins = apply_filters( 'wpex_utl_margins', $margins ); return (array) $margins; } /** * Return utility letter spacing options. */ function wpex_utl_letter_spacing(): array { $letter_spacing = [ '' => esc_html__( 'Default', 'total' ), 'tighter' => esc_html__( 'Tighter', 'total' ), 'tight' => esc_html__( 'Tight', 'total' ), 'normal' => esc_html__( 'Normal', 'total' ), 'wide' => esc_html__( 'Wide', 'total' ), 'wider' => esc_html__( 'Wider', 'total' ), 'widest' => esc_html__( 'Widest', 'total' ), ]; /** * Filters the line_height options. * * @param array $letter_spacing */ $letter_spacing = apply_filters( 'wpex_utl_letter_spacing', $letter_spacing ); return (array) $letter_spacing; } /** * Return utility line height options. */ function wpex_utl_line_height(): array { $line_height = [ '' => esc_html__( 'Default', 'total' ), 'tight' => esc_html__( 'Tight', 'total' ), 'snug' => esc_html__( 'Snug', 'total' ), 'normal' => esc_html__( 'Normal', 'total' ), 'relaxed' => esc_html__( 'Relaxed', 'total' ), 'loose' => esc_html__( 'Loose', 'total' ), ]; /** * Filters the line height options. * * @param array $line_height */ $line_height = apply_filters( 'wpex_utl_line_height', $line_height ); return (array) $line_height; } /** * Get utility shadows. */ function wpex_utl_shadows(): array { $shadows = [ '' => esc_html__( 'Default', 'total' ), 'shadow-none' => esc_html__( 'None', 'total' ), 'shadow-xs' => esc_html__( 'Extra Small', 'total' ), 'shadow-sm' => esc_html__( 'Small', 'total' ), 'shadow' => esc_html__( 'Average', 'total' ), 'shadow-md' => esc_html__( 'Medium', 'total' ), 'shadow-lg' => esc_html__( 'Large', 'total' ), 'shadow-xl' => esc_html__( 'Extra Large', 'total' ), 'shadow-2xl' => esc_html__( '2x Large', 'total' ), ]; /** * Filters the shadow options. * * @param array $shadows */ $shadows = apply_filters( 'wpex_utl_shadows', $shadows ); return (array) $shadows; } /** * Get utility divider styles. */ function wpex_utl_divider_styles(): array { $styles = [ '' => esc_html__( 'Default', 'total' ), 'solid' => esc_html__( 'Solid', 'total' ), 'dotted' => esc_html__( 'Dotted', 'total' ), 'dashed' => esc_html__( 'Dashed', 'total' ), ]; /** * Filters the divider styles options. * * @param array $styles */ $styles = apply_filters( 'wpex_utl_divider_styles', $styles ); return (array) $styles; } /** * Get utility opacity. */ function wpex_utl_opacities(): array { $opacities = [ '' => esc_html__( 'Default', 'total' ), '10' => '10%', '20' => '20%', '30' => '30%', '40' => '40%', '50' => '50%', '60' => '60%', '70' => '70%', '80' => '80%', '90' => '90%', '100' => '100%', ]; /** * Filters the opacity options. * * @param array $opacities */ $opacities = apply_filters( 'wpex_utl_opacities', $opacities ); return (array) $opacities; } /** * Get utility breakpoints. */ function wpex_utl_breakpoints(): array { $breakpoints = [ '' => esc_html__( 'Default', 'total' ), 'sm' => esc_html__( 'sm - 640px', 'total' ), 'md' => esc_html__( 'md - 768px', 'total' ), 'lg' => esc_html__( 'lg - 1024px', 'total' ), 'xl' => esc_html__( 'xl - 1280px', 'total' ), ]; /** * Filters the breakpoint options. * * @param array $breakpoints */ $breakpoints = apply_filters( 'wpex_utl_breakpoints', $breakpoints ); return (array) $breakpoints; } /** * Return utility visibility class. */ function wpex_utl_visibility_class( $show_hide = 'hide', $screen = '' ) { if ( ! $screen || ! array_key_exists( $screen, wpex_utl_breakpoints() ) ) { return; } $class = ''; switch ( $show_hide ) { case 'hide': $class = 'wpex-hidden wpex-' . sanitize_html_class( $screen ) . '-block'; break; case 'show': $class = 'wpex-' . sanitize_html_class( $screen ) . '-hidden'; break; } return $class; } /** * Return utility font size class. */ function wpex_sanitize_utl_font_size( $font_size = '' ) { if ( ! $font_size || ! array_key_exists( $font_size, wpex_utl_font_sizes() ) ) { return; } switch ( $font_size ) { case '5xl': case '6xl': case '7xl': $class = 'wpex-text-4xl wpex-md-text-' . sanitize_html_class( $font_size ); break; default: $class = 'wpex-text-' . sanitize_html_class( $font_size ); break; } /** * Returns a font size classname. * * @param string|null $class * @param string $font_size */ $class = apply_filters( 'wpex_utl_font_size_class', $class, $font_size ); return $class; }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件