文件操作 - sidr.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/jimbrandstatter/public_html/wp-content/themes/Total/inc/mobile/menu/sidr.php
编辑文件内容
<?php namespace TotalTheme\Mobile\Menu; \defined( 'ABSPATH' ) || exit; /** * Sidr mobile Menu. */ class Sidr { /** * JS handle. */ public const JS_HANDLE = 'wpex-mobile-menu-sidr'; /** * JS object. */ public const JS_OBJECT = 'wpex_mobile_menu_sidr_params'; /** * Instance. */ private static $instance; /** * Create or retrieve the instance of our class. */ public static function instance() { if ( \is_null( static::$instance ) ) { static::$instance = new self(); } return static::$instance; } /** * Register Scripts. */ public function register_js(): void { \wp_register_script( self::JS_HANDLE, \totaltheme_get_js_file( 'frontend/mobile-menu/sidr' ), [ \WPEX_THEME_JS_HANDLE ], \WPEX_THEME_VERSION, true ); if ( $l10n = $this->get_l10n() ) { \wp_localize_script( self::JS_HANDLE, self::JS_OBJECT, $l10n ); } } /** * Enqueue Scripts. */ public function enqueue_js(): void { \wp_enqueue_script( self::JS_HANDLE ); } /** * Check if the sidr mobile menu is enabled. */ public function is_enabled(): bool { return 'sidr' === totaltheme_call_static( 'Mobile\Menu', 'style' ) && totaltheme_call_static( 'Mobile\Menu', 'is_enabled' ); } /** * Returns l10n. */ private function get_l10n(): array { $l10n = [ 'source' => $this->get_source(), 'side' => $this->get_position(), 'dark_surface' => \wp_validate_boolean( get_theme_mod( 'mobile_menu_sidr_dark_surface', true ) ), 'displace' => \wp_validate_boolean( get_theme_mod( 'mobile_menu_sidr_displace', false ) ), 'aria_label' => \esc_attr( \wpex_get_aria_label( 'mobile_menu' ) ), 'aria_label_close' => \esc_attr( \wpex_get_aria_label( 'mobile_menu_close' ) ), 'class' => [ 'wpex-mobile-menu' ], 'speed' => 300, ]; if ( \get_theme_mod( 'mobile_menu_sidr_background' ) ) { $l10n['class'] = 'has-background'; } $l10n = (array) apply_filters( 'totaltheme/mobile/menu/sidr/l10n', $l10n ); return $l10n; } /** * Returns source. */ private function get_source(): string { $items = []; if ( \wpex_has_mobile_menu_alt() ) { $items['nav'] = '#mobile-menu-alternative'; } else { $items['nav'] = '#site-navigation'; } if ( \get_theme_mod( 'mobile_menu_search', true ) ) { $items['search'] = '#mobile-menu-search'; } /** * Filters the mobile menu sidr source. * * @param array $items The array of elements (ids) to include in the sidebar mobile menu. */ $items = (array) \apply_filters( 'totaltheme/mobile/menu/sidr/source', $items ); /*** deprecated ***/ $items = (array) \apply_filters( 'wpex_mobile_menu_source', $items ); return \implode( ', ', $items ); } /** * Returns sidr position (left or right). */ private function get_position(): string { $position = \get_theme_mod( 'mobile_menu_sidr_direction' ); if ( ! $position ) { if ( totaltheme_call_static( 'Header\Core', 'has_flex_container' ) ) { $toggle_style = \wpex_header_menu_mobile_toggle_style(); if ( 'centered_logo' === $toggle_style || 'next_to_logo' === $toggle_style ) { $position = 'left'; } else { $position = 'right'; } } else { $position = 'right'; } } return $position; } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件