文件操作 - menu.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/jimbrandstatter/public_html/wp-content/themes/Total/inc/mobile/menu.php
编辑文件内容
<?php namespace TotalTheme\Mobile; \defined( 'ABSPATH' ) || exit; /** * Mobile Menu. */ class Menu { /** * Mobile menu is enabled or not. */ protected static $is_enabled; /** * Mobile menu style. */ protected static $style; /** * The mobile menu breakpoint. */ protected static $breakpoint; /** * Static-only class. */ private function __construct() {} /** * Hook mobile menu template part into the wp_footer hook. */ public static function get_template_part(): void { if ( ! self::is_enabled() ) { return; } $style = self::style(); switch( $style ) { case 'toggle': $template_part = 'mobile_menu_toggle'; break; case 'full_screen': $template_part = 'mobile_menu_full_screen'; break; case 'sidr': $template_part = 'mobile_menu_sidr'; break; default: $template_part = ''; break; } if ( $template_part ) { \wpex_get_template_part( $template_part ); } } /** * Returns the mobile menu style. */ public static function style(): string { if ( ! \is_null( self::$style ) ) { return self::$style; } $style = \wpex_is_layout_responsive() ? \get_theme_mod( 'mobile_menu_style' ) : 'disabled'; if ( empty( $style ) ) { $style = 'sidr'; } // @note we don't add a Header:is_custom() check incase we want to use the mobile menu // in a custom header manually. if ( totaltheme_call_static( 'Header\Menu', 'is_custom' ) && ! \wpex_has_mobile_menu_alt() ) { $style = 'disabled'; } /** * Filters the mobile menu style. * * @param string $style */ $style = \apply_filters( 'totaltheme/mobile/menu/style', $style ); /*** deprecated ***/ $style = \apply_filters( 'wpex_mobile_menu_style', $style ); $style = \apply_filters( 'wpex_header_menu_mobile_style', $style ); self::$style = (string) $style; return self::$style; } /** * Check if the mobile menu is enabled. */ public static function is_enabled(): bool { if ( ! \is_null( self::$is_enabled ) ) { return self::$is_enabled; } if ( totaltheme_call_static( 'Header\Core', 'is_custom' ) ) { self::$is_enabled = false; return false; // don't run through filters. } $check = false; if ( ( \wpex_has_mobile_menu_alt() || totaltheme_call_static( 'Header\Menu', 'is_enabled' ) ) && \wpex_is_layout_responsive() && 'disabled' !== self::style() ) { $check = true; } /** * Filters whether the mobile menu is enabled or not. * * @param boolean $check */ $check = \apply_filters( 'totaltheme/mobile/menu/is_enabled', $check ); /*** deprecated ***/ $check = \apply_filters( 'wpex_has_mobile_menu', $check ); // @todo deprecate $check = \apply_filters( 'wpex_has_header_menu_mobile', $check ); self::$is_enabled = (bool) $check; return self::$is_enabled; } /** * Returns the mobile menu breakpoint. */ public static function breakpoint() { if ( ! \is_null( self::$breakpoint ) ) { return self::$breakpoint; } $breakpoint = \get_theme_mod( 'mobile_menu_breakpoint' ); if ( $breakpoint ) { $breakpoint = \absint( $breakpoint ); } /** * Filters the mobile menu breakpoint. * * @param int $breakpoint */ $breakpoint = (int) \apply_filters( 'totaltheme/mobile/menu/breakpoint', $breakpoint ); /*** deprecated ***/ $breakpoint = (int) \apply_filters( 'wpex_header_menu_mobile_breakpoint', $breakpoint ); self::$breakpoint = \absint( $breakpoint ) ?: 959; // can't be empty since Total 5.0 return self::$breakpoint; } /** * Outputs mobile menu top hook content. */ public static function hook_top(): void { \ob_start(); $top = \wpex_hook_mobile_menu_top(); $top = \ob_get_clean(); if ( $top ) { $style = self::style(); $utl_class = ''; switch ( $style ) { case 'full_screen': case 'toggle': $utl_class = ' wpex-pb-20'; break; } echo '<div class="wpex-mobile-menu-top' . $utl_class . '">' . $top . '</div>'; } } /** * Outputs mobile menu bottom hook content. */ public static function hook_bottom(): void { \ob_start(); $bottom = \wpex_hook_mobile_menu_bottom(); $bottom = \ob_get_clean(); if ( $bottom ) { $style = self::style(); $utl_class = ''; switch ( $style ) { case 'full_screen': $utl_class = ' wpex-pt-20'; break; case 'toggle': $utl_class = ' wpex-pb-20'; break; } echo '<div class="wpex-mobile-menu-bottom' . $utl_class . '">' . $bottom . '</div>'; } } /** * Outputs mobile menu searchform. */ public static function search_form( $args = [] ): void { if ( ! \get_theme_mod( 'mobile_menu_search', true ) ) { return; } \wpex_get_template_part( 'mobile_searchform', null, $args ); } /** * Register mobile menu js. */ public static function register_js(): void { if ( ! self::is_enabled() ) { return; } switch ( self::style() ) { case 'full_screen': totaltheme_call_non_static( 'Mobile\Menu\Full_Screen', 'register_js' ); break; case 'toggle': totaltheme_call_non_static( 'Mobile\Menu\Toggle', 'register_js' ); break; case 'sidr': totaltheme_call_non_static( 'Mobile\Menu\Sidr', 'register_js' ); break; } } /** * Enqueue mobile menu js. */ public static function enqueue_js(): void { if ( ! self::is_enabled() ) { return; } switch ( self::style() ) { case 'full_screen': totaltheme_call_non_static( 'Mobile\Menu\Full_Screen', 'enqueue_js' ); break; case 'toggle': totaltheme_call_non_static( 'Mobile\Menu\Toggle', 'enqueue_js' ); break; case 'sidr': totaltheme_call_non_static( 'Mobile\Menu\Sidr', 'enqueue_js' ); break; } } /** * Returns the submenu toggle icon. */ public static function get_submenu_toggle_icon(): string { $icon = get_theme_mod( 'mobile_menu_open_submenu_icon' ) ?: 'angle-down'; $icon = \apply_filters( 'wpex_mobile_menu_open_submenu_icon', $icon ); return (string) $icon; } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件