文件操作 - country.php
返回文件管理
返回主菜单
删除本文件
文件: /home/www/public/wp-content/plugins/tutor/includes/country.php
编辑文件内容
<?php /** * Country List * * @package Tutor\Includes * @author Themeum <support@themeum.com> * @link https://themeum.com * @since 3.0.0 */ defined( 'ABSPATH' ) || exit; if ( ! function_exists( 'tutor_get_country_list' ) ) { /** * Get country list. * * @since 3.0.0 * * @return array */ function tutor_get_country_list() { $file = trailingslashit( tutor()->path ) . 'assets/json/countries.json'; if ( ! file_exists( $file ) ) { return array(); } $data = file_get_contents( $file ); return json_decode( $data, true ); } } if ( ! function_exists( 'tutor_get_country_info_by_name' ) ) { /** * Get country info by country name * * @since 3.0.0 * * @param string $country_name country name. * * @return array|null */ function tutor_get_country_info_by_name( $country_name ) { $countries = tutor_get_country_list(); foreach ( $countries as $country ) { if ( strtolower( $country['name'] ) === strtolower( $country_name ) ) { return $country; } } } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件