文件操作 - js.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/jimbrandstatter/public_html/wp-content/themes/Total/inc/scripts/js.php
编辑文件内容
<?php namespace TotalTheme\Scripts; \defined( 'ABSPATH' ) || exit; /** * JS Scripts. */ class JS { /** * Returns the correct JS extension for files. */ public static function js_extension() { return \WPEX_MINIFY_JS ? '.min.js' : '.js'; } /** * Register Theme scripts. */ public static function register() { $js_extension = self::js_extension(); \wp_register_script( 'wpex-superfish', \totaltheme_get_js_file( 'lib/superfish/jquery.superfish' ), [ 'jquery', 'hoverIntent' ], \WPEX_THEME_VERSION, true ); /** * Filters the superfish js params. * * @param array $params */ $superfish_params = (array) \apply_filters( 'wpex_superfish_params', [ 'delay' => 600, 'speed' => 'fast', 'speedOut' => 'fast', ] ); \wp_localize_script( 'wpex-superfish', 'wpex_superfish_params', $superfish_params ); // Easing. \wp_register_script( 'easing', \totaltheme_get_js_file( 'lib/easing/jquery.easing' ), [ 'jquery' ], '1.3.2', true ); // Comment Reply. \wp_register_script( 'wpex-comment-reply', \totaltheme_get_js_file( 'frontend/wp/comment-reply' ), [], '2.7.0', true ); // Slider Pro. \wp_deregister_script( 'slider-pro' ); // prevent issues since the version in Total has some tweaks. \wp_register_script( 'slider-pro', \totaltheme_get_js_file( 'lib/slider-pro/jquery.sliderPro' ), [ 'jquery' ], \WPEX_THEME_VERSION, // modified a bit by Total. true ); \wp_register_script( 'wpex-slider-pro-custom-thumbs', \totaltheme_get_js_file( 'lib/slider-pro/jquery.sliderProCustomThumbnails' ), [ 'jquery', 'slider-pro' ], \WPEX_THEME_VERSION, true ); \wp_register_script( 'wpex-slider-pro', \totaltheme_get_js_file( 'frontend/vendor/slider-pro' ), [ 'jquery', 'slider-pro', \WPEX_THEME_JS_HANDLE ], // @todo WPEX_THEME_JS_HANDLE no longer needed? \WPEX_THEME_VERSION, true ); $slider_prev_icon = \apply_filters( 'wpex_slider_prev_icon', 'material/arrow-back-ios' ); $slider_next_icon = \apply_filters( 'wpex_slider_next_icon', 'material/arrow-forward-ios' ); \wp_localize_script( 'wpex-slider-pro', 'wpex_slider_pro_params', [ 'i18n' => [ 'NEXT' => \esc_html__( 'next Slide', 'total' ), 'PREV' => \esc_html__( 'previous Slide', 'total' ), 'GOTO' => \esc_html__( 'go to slide', 'total' ), ], 'previousArrow' => '<div class="sp-arrow sp-previous-arrow" tabindex="0" role="button"><span class="screen-reader-text">' . esc_html__( 'previous slide', 'total' ) . '</span><span class="sp-arrow-inner wpex-flex wpex-items-center wpex-justify-center wpex-w-100 wpex-h-100">' . \totaltheme_call_static( 'Theme_Icons', 'get_icon', $slider_prev_icon ) . '</span></div>', 'nextArrow' => '<div class="sp-arrow sp-next-arrow" tabindex="0" role="button"><span class="screen-reader-text">' . esc_html__( 'next slide', 'total' ) . '</span></span><span class="sp-arrow-inner wpex-flex wpex-items-center wpex-justify-center wpex-w-100 wpex-h-100">' . \totaltheme_call_static( 'Theme_Icons', 'get_icon', $slider_next_icon ) . '</div>', ] ); // Social share. \wp_register_script( 'wpex-social-share', \totaltheme_get_js_file( 'frontend/social-share' ), [], \WPEX_THEME_VERSION, true ); // Isotope. \wp_register_script( 'isotope', \totaltheme_get_js_file( 'lib/isotope/isotope.pkgd' ), [ 'imagesloaded' ], '3.0.6', true ); \wp_register_script( 'wpex-isotope', \totaltheme_get_js_file( 'frontend/vendor/isotope' ), [ 'isotope' ], \WPEX_THEME_VERSION, true ); \wp_localize_script( 'wpex-isotope', 'wpex_isotope_params', \wpex_get_masonry_settings() ); // Toggle Bar \wp_register_script( 'wpex-toggle-bar', \totaltheme_get_js_file( 'frontend/toggle-bar' ), [], \WPEX_THEME_VERSION, true ); // Parallax Backgrounds. \wp_register_script( 'wpex-parallax-backgrounds', \totaltheme_get_js_file( 'frontend/parallax-backgrounds' ), [], \WPEX_THEME_VERSION, true ); // Edit Links. if ( is_user_logged_in() ) { \wp_register_script( 'wpex-hide-edit-links', \totaltheme_get_js_file( 'frontend/hide-edit-links' ), [], \WPEX_THEME_VERSION, true ); } // Menu Widget Accordion. \wp_register_script( 'wpex-widget-nav-menu', \totaltheme_get_js_file( 'frontend/wp/widget-nav-menu' ), [ \WPEX_THEME_JS_HANDLE ], \WPEX_THEME_VERSION, true ); // Scripts that are dependent on the total.min.js file should be registered last. totaltheme_call_static( 'Lightbox', 'register_js' ); totaltheme_call_static( 'Mobile\Menu', 'register_js' ); } /** * Enqueue Theme scripts. */ public static function enqueue() { // Comment reply. if ( \is_singular() && \comments_open() && \get_option( 'thread_comments' ) && ! \wp_script_is ( 'comment-reply' ) ) { \wp_enqueue_script( 'wpex-comment-reply' ); } // Menu dropdowns. if ( 'sfhover' === \totaltheme_call_static( 'Header\Menu', 'get_dropdown_method' ) && \totaltheme_call_static( 'Header\Menu', 'is_enabled' ) ) { \wp_enqueue_script( 'wpex-superfish' ); } // jQuery easing. if ( totaltheme_call_non_static( 'Local_Scroll', 'get_easing_function' ) ) { \wp_enqueue_script( 'easing' ); } // Load minified theme JS. if ( \WPEX_MINIFY_JS ) { \wp_enqueue_script( WPEX_THEME_JS_HANDLE, \totaltheme_get_js_file( 'frontend/core' ), [], \WPEX_THEME_VERSION, true ); } // Load all non-minified Theme js else { \wp_enqueue_script( 'wpex-polyfills', \totaltheme_get_js_file( 'frontend/core/polyfills' ), [], \WPEX_THEME_VERSION, true ); \wp_enqueue_script( 'wpex-equal-heights', \totaltheme_get_js_file( 'frontend/core/wpexEqualHeights' ), [], \WPEX_THEME_VERSION, true ); // Core global functions \wp_enqueue_script( WPEX_THEME_JS_HANDLE, \totaltheme_get_js_file( 'frontend/core' ), [ 'wpex-polyfills', 'wpex-equal-heights' ], \WPEX_THEME_VERSION, true ); } // Localize core js if ( $l10n = self::l10n() ) { \wp_localize_script( \WPEX_THEME_JS_HANDLE, 'wpex_theme_params', $l10n ); } // Total dependent scripts - these should load last to prevent messing up script ordering. totaltheme_call_static( 'Lightbox', 'enqueue_global_scripts' ); totaltheme_call_static( 'Mobile\Menu', 'enqueue_js' ); } /** * Main js l10n. */ protected static function l10n() { $header_style = \totaltheme_call_static( 'Header\Core', 'style' ); $mm_breakpoint = \totaltheme_call_static( 'Mobile\Menu', 'breakpoint' ); $l10n = [ 'menuWidgetAccordion' => true, 'mobileMenuBreakpoint' => $mm_breakpoint, // Translatable strings. 'i18n' => [ 'openSubmenu' => \esc_html__( 'Open submenu of %s', 'total' ), 'closeSubmenu' => \esc_html__( 'Close submenu of %s', 'total' ), ], ]; /**** Header params ****/ if ( 'disabled' !== $header_style ) { // Sticky Header. if ( \totaltheme_call_static( 'Header\Sticky', 'is_enabled' ) ) { $l10n['stickyHeaderStyle'] = \totaltheme_call_static( 'Header\Sticky', 'style' ); $l10n['hasStickyMobileHeader'] = \totaltheme_call_static( 'Header\Sticky', 'has_mobile_support' ); $l10n['stickyHeaderBreakPoint'] = \totaltheme_call_static( 'Header\Sticky', 'breakpoint' ); // Sticky header start position. $fixed_startp = \totaltheme_call_static( 'Header\Sticky', 'get_start_position' ); if ( $fixed_startp ) { $fixed_startp = \str_replace( 'px', '', $fixed_startp ); $l10n['stickyHeaderStartPosition'] = $fixed_startp; // can be int or element class/id } // Shrink sticky header > used for local-scroll offset. if ( \totaltheme_call_static( 'Header\Sticky', 'is_shrink_enabled' ) ) { $l10n['hasStickyHeaderShrink'] = true; $l10n['hasStickyMobileHeaderShrink'] = \totaltheme_call_static( 'Header\Sticky', 'is_shrink_enabled_mobile' ); $shrink_header_height = \intval( \get_theme_mod( 'fixed_header_shrink_end_height' ) ?: 50 ); if ( ! \totaltheme_call_static( 'Header\Core', 'has_flex_container' ) ) { $shrink_header_height = $shrink_header_height + 20; } $l10n['shrinkHeaderHeight'] = $shrink_header_height; } } // Sticky Navbar. if ( \wpex_has_sticky_header_menu() ) { $l10n['stickyNavbarBreakPoint'] = $mm_breakpoint; } // Header five. if ( 'five' === $header_style ) { $l10n['headerFiveSplitOffset'] = 1; } } // End header params. // Sticky topBar. if ( \totaltheme_call_static( 'Topbar\Core', 'is_sticky' ) ) { $l10n['stickyTopBarBreakPoint'] = 960; $l10n['hasStickyTopBarMobile'] = \wp_validate_boolean( \get_theme_mod( 'top_bar_sticky_mobile', true ) ); } // Custom selects. if ( \apply_filters( 'wpex_custom_selects_js', true ) ) { $l10n['selectArrowIcon'] = \esc_html( \totaltheme_call_static( 'Forms\Select_Wrap', 'get_arrow_icon_html' ) ); $l10n['customSelects'] = '.widget_categories form,.widget_archive select,.vcex-form-shortcode select'; // WooCommerce custom selects - @todo move to WooCommerce dir. if ( \totaltheme_is_integration_active( 'woocommerce' ) && \totaltheme_call_static( 'Integration\WooCommerce', 'is_advanced_mode' ) ) { $l10n['customSelects'] .= ',.woocommerce-ordering .orderby,#dropdown_product_cat,.single-product .variations_form .variations select'; if ( class_exists( 'WC_Product_Addons' ) ) { $l10n['customSelects'] .= ',.wc-pao-addon .wc-pao-addon-wrap select'; } } // BBPress custom selects. if ( \totaltheme_is_integration_active( 'bbpress' ) ) { $l10n['customSelects'] .= ',#bbp_stick_topic_select,#bbp_topic_status_select'; } } /** * Local Scroll args. */ $local_scroll_l10n = totaltheme_call_non_static( 'Local_Scroll', 'get_l10n' ); if ( \is_array( $local_scroll_l10n ) ) { $l10n = \array_merge( $l10n, $local_scroll_l10n ); } /** * Icons. */ $mm_subtoggle_icon = \totaltheme_call_static( 'Mobile\Menu', 'get_submenu_toggle_icon' ); if ( 'material/add' === $mm_subtoggle_icon ) { $l10n['mobileMenuOpenSubmenuIconActive'] = \totaltheme_call_static( 'Theme_Icons', 'get_icon', 'material/remove', 'wpex-open-submenu__icon wpex-open-submenu__icon--open wpex-hidden' ); $mm_subtoggle_icon_class = 'wpex-open-submenu__icon'; } else { $mm_subtoggle_icon_class = 'wpex-open-submenu__icon wpex-transition-all wpex-duration-300'; } $l10n['mobileMenuOpenSubmenuIcon'] = \totaltheme_call_static( 'Theme_Icons', 'get_icon', $mm_subtoggle_icon, $mm_subtoggle_icon_class ); /** * Filters the array of localized args for the theme js. * * @param array $l10n * @todo soft deprecated 5.7.0 @todo remove completely. */ $l10n = (array) \apply_filters( 'wpex_localize_array', $l10n ); return $l10n; } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件