文件操作 - Helper.php
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/ionos-journey/inc/Helper.php
编辑文件内容
<?php namespace Ionos\Journey; // Do not allow direct access! use Ionos\Libraryjourney\Config; use function defined; use function plugins_url; if ( ! defined( 'ABSPATH' ) ) { die(); } /** * Helper class */ class Helper { const FALLBACK_LANG = 'en'; /** * Get the url of the css folder * * @param string $file css file name. * * @return string */ public static function get_css_url( $file = '' ) { return plugins_url( 'css/' . $file, __DIR__ ); } /** * Get the path of the css folder * * @param string $file css file name. * * @return string */ public static function get_css_path( $file ) { return plugin_dir_path( __DIR__ ) . 'css/' . $file; } /** * Get the url to the js folder. * * @param string $file js file name. * * @return string */ public static function get_js_url( $file = '' ) { return plugins_url( 'js/' . $file, __DIR__ ); } /** * Get the url to the js folder. * * @return string */ public static function get_json_path() { return plugin_dir_path( __DIR__ ) . 'config/config-template.json'; } /** * Get the path of the js folder * * @param string $file js file name. * * @return string */ public static function get_js_path( $file ) { return plugin_dir_path( __DIR__ ) . 'js/' . $file; } /** * Get the configuration for the given key. * * @param string $key config key. * * @return mixed */ public static function get_configuration( $key ) { $language = strtolower( explode( '_', \get_locale() )[0] ); if ( json_decode( Config::get( 'data.' . $language . '_' . $key ), true ) !== null ) { return json_decode( Config::get( 'data.' . $language . '_' . $key ), true ); } return json_decode( Config::get( 'data.' . self::FALLBACK_LANG . '_' . $key ), true ); } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件