文件操作 - geo-page-template.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/steemteam/public_html/wp-content/mu-plugins/geo-page-template.php
编辑文件内容
<?php /** * Plugin Name: Steemteam Custom Page Templates * Description: Registers Geo Page, Location Page, and Service Page templates. * Version: 1.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; } add_filter( 'theme_page_templates', function( $post_templates ) { $post_templates['template-geo-page.php'] = 'Geo Page'; $post_templates['template-location-page.php'] = 'Location Page'; $post_templates['template-service-page.php'] = 'Service Page'; return $post_templates; } ); add_filter( 'template_include', function( $template ) { if ( is_singular( 'page' ) ) { $page_template = get_page_template_slug( get_queried_object_id() ); $allowed_templates = [ 'template-geo-page.php', 'template-location-page.php', 'template-service-page.php', ]; if ( in_array( $page_template, $allowed_templates, true ) ) { $child_file = trailingslashit( get_stylesheet_directory() ) . $page_template; $parent_file = trailingslashit( get_template_directory() ) . $page_template; if ( file_exists( $child_file ) ) { return $child_file; } if ( file_exists( $parent_file ) ) { return $parent_file; } } } return $template; }, 99 );
修改文件时间
将文件时间修改为当前时间的前一年
删除文件