文件操作 - body-class.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/jimbrandstatter/public_html/wp-content/themes/Total/inc/hooks/body-class.php
编辑文件内容
<?php namespace TotalTheme\Hooks; \defined( 'ABSPATH' ) || exit; /** * Hooks into "body_class". */ final class Body_Class { /** * Static-only class. */ private function __construct() {} /** * Callback method. */ public static function callback( $classes ) { $extra_classes = self::get_theme_classes(); if ( $extra_classes ) { $classes = \array_merge( $classes, $extra_classes ); } return $classes; } /** * Returns theme classes to add to the body class. */ protected static function get_theme_classes() { $classes = []; $post_id = \wpex_get_current_post_id(); $main_layout = \wpex_site_layout( $post_id ); // Customizer. if ( \is_customize_preview() ) { $classes[] = 'is_customize_preview'; // @todo remove? } // Main class. $classes[] = 'wpex-theme'; // Responsive. if ( \wpex_is_layout_responsive() ) { $classes[] = 'wpex-responsive'; } // Layout Style. $classes[] = \sanitize_html_class( $main_layout ) . '-main-layout'; //@todo deprecate // Check if the WPbakery is being used on this page. // @todo rename these classes. if ( \WPEX_VC_ACTIVE && totaltheme_call_static( 'Integration\WPBakery\Helpers', 'post_has_wpbakery', $post_id ) ) { $classes[] = 'has-composer'; } else { $classes[] = 'no-composer'; } // Live site class. if ( ! \wpex_vc_is_inline() ) { $classes[] = 'wpex-live-site'; // @todo remove this unneded check. } // Add primary element bottom margin. if ( \wpex_has_primary_bottom_spacing() ) { $classes[] = 'wpex-has-primary-bottom-spacing'; } // Boxed Layout dropshadow. if ( 'boxed' === $main_layout && \get_theme_mod( 'boxed_dropdshadow' ) ) { $classes[] = 'wrap-boxshadow'; } // Main & Content layouts. $classes[] = 'site-' . \sanitize_html_class( $main_layout ); // @added in 5.1.3 $classes[] = 'content-' . \sanitize_html_class( wpex_content_area_layout( $post_id ) ); // Sidebar. if ( \wpex_has_sidebar() ) { $classes[] = 'has-sidebar'; } // Extra header classes. if ( totaltheme_call_static( 'Header\Core', 'is_enabled' ) ) { if ( totaltheme_call_static( 'Header\Vertical', 'is_enabled' ) ) { $classes[] = 'wpex-has-vertical-header'; $classes[] = 'wpex-vertical-header-' . \sanitize_html_class( totaltheme_call_static( 'Header\Vertical', 'position' ) ); if ( 'fixed' === totaltheme_call_static( 'Header\Vertical', 'style' ) ) { $classes[] = 'wpex-fixed-vertical-header'; } } } else { $classes[] = 'wpex-site-header-disabled'; } // Topbar. if ( totaltheme_call_static( 'Topbar\Core', 'is_enabled' ) ) { $classes[] = 'has-topbar'; } // Single Post cagegories if ( \is_singular( 'post' ) ) { $cats = \get_the_category( $post_id ); foreach ( $cats as $cat ) { $classes[] = 'post-in-category-' . \sanitize_html_class( $cat->category_nicename ); } } // Widget Icons. $icon_format = totaltheme_call_static( 'Theme_Icons', 'get_format' ); if ( \get_theme_mod( 'has_widget_icons', true ) && 'font' === $icon_format ) { $classes[] = 'sidebar-widget-icons'; } if ( 'svg' === $icon_format ) { $classes[] = 'svg-ticons'; } // Overlay header style. if ( totaltheme_call_static( 'Header\Overlay', 'is_enabled' ) ) { $classes[] = 'has-overlay-header'; } else { $classes[] = 'hasnt-overlay-header'; } // Footer reveal. if ( totaltheme_call_static( 'Footer\Core', 'is_enabled' ) ) { if ( totaltheme_call_static( 'Footer\Core', 'has_reveal' ) ) { $classes[] = 'footer-has-reveal'; } } // Fixed Footer - adds min-height to main wraper. if ( \get_theme_mod( 'fixed_footer', false ) ) { $classes[] = 'wpex-has-fixed-footer'; } // Disabled header. if ( \totaltheme_call_static( 'Page\Header', 'is_enabled' ) ) { if ( 'background-image' === \totaltheme_call_static( 'Page\Header', 'style' ) ) { $classes[] = 'page-with-background-title'; } } else { $classes[] = 'page-header-disabled'; } // Disable title margin - @todo rename to "page-header-title--no-margin" or something like that? if ( $post_id ) { $disable_header_margin = \get_post_meta( $post_id, 'wpex_disable_header_margin', true ); if ( $disable_header_margin && \wpex_validate_boolean( $disable_header_margin ) ) { $classes[] = 'no-header-margin'; } } // Page slider. if ( \wpex_has_post_slider( $post_id ) && $slider_position = \wpex_post_slider_position( $post_id ) ) { $classes[] = 'page-with-slider'; // Deprecated @todo remove this class. $classes[] = 'has-post-slider'; $classes[] = 'post-slider-' . \sanitize_html_class( \str_replace( '_', '-', $slider_position ) ); } // Font smoothing. if ( \get_theme_mod( 'enable_font_smoothing', false ) ) { $classes[] = 'wpex-antialiased'; } // Mobile menu toggle style. if ( totaltheme_call_static( 'Mobile\Menu', 'is_enabled' ) ) { // Mobile menu toggle style. $classes[] = 'wpex-mobile-toggle-menu-' . \sanitize_html_class( \wpex_header_menu_mobile_toggle_style() ); // Mobile menu style. $classes[] = 'has-mobile-menu'; } elseif ( ! totaltheme_call_static( 'Header\Core', 'has_flex_container' ) && totaltheme_call_static( 'Header\Menu', 'is_enabled' ) ) { $classes[] = 'hasnt-mobile-menu'; // these classes cause issues with new flex styles. } // Navbar inner span bg. if ( \get_theme_mod( 'menu_link_span_background' ) ) { $classes[] = 'navbar-has-inner-span-bg'; } // Togglebar. if ( 'inline' === \wpex_togglebar_style() ) { $classes[] = 'togglebar-is-inline'; } // Frame border. if ( \wpex_has_site_frame_border() ) { $classes[] = 'has-frame-border'; } // Pagination gutter. $pag_gutter = \get_theme_mod( 'pagination_gutter', null ); if ( $pag_gutter && '0' !== $pag_gutter && '-1' !== $pag_gutter ) { $classes[] = 'has-pagination-gutter'; } // Social share position. if ( \wpex_has_social_share() ) { $position = \wpex_social_share_position(); if ( $position ) { $classes[] = 'wpex-share-p-' . \sanitize_html_class( $position ); } } // Post author comment highlight/ if ( \get_theme_mod( 'bypostauthor_highlight' ) ) { $classes[] = 'comment-author-highlight'; } // No JS class gets removed when JS loads. $classes[] = 'wpex-no-js'; return $classes; } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件