文件操作 - svgs.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/jimbrandstatter/public_html/wp-content/themes/Total/inc/functions/svgs.php
编辑文件内容
<?php defined( 'ABSPATH' ) || exit; /** * Renders theme svg html. * * @param string $svg The SVG we are going to display. * @param int $size The size to be used for the svg width and height. * @return html */ function wpex_svg( $file = '', $size = 20 ): void { echo wpex_get_svg( $file, $size ); } /** * Returns theme svg html. * * @param string $svg The SVG we are going to display. * @param int $size The size to be used for the svg width and height. * @return html */ function wpex_get_svg( $file = '', $size = 20 ): string { if ( ! $file ) { return ''; } // Fallbacks prior to the 5.4.5 update. switch ( $file ) { case 'close': $file = 'material/close'; break; case 'wp-spinner': case 'spinner': $file = 'loaders/wordpress'; break; case 'total': case 'total-logo': $file = 'brands/total'; break; case 'wpbakery-logo': case 'wpbakery': $file = 'brands/wpbakery'; break; default: break; } // $file = str_replace( 'custom/', '', $file ); // @todo? $svg = locate_template( "assets/svgs/{$file}.svg", false ); $svg = $svg ? file_get_contents( $svg ) : ''; if ( $svg && $size ) { // $svg = preg_replace( '/(width|height)="\d*"\s/', '', $svg, 1 ); // @deprecated 5.7.2 - causes issues with values added in rect. $svg = str_replace( '<svg', '<svg height="' . esc_attr( $size['height'] ?? $size ) . '" width="' . esc_attr( $size['width'] ?? $size ) . '"', $svg ); } /** * Filters svg icon output * * @param string $svg */ $svg = (string) apply_filters( 'wpex_svg', $svg, $svg, $size ); return $svg; }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件