文件操作 - gutenberg.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/jimbrandstatter/public_html/wp-content/themes/Total/inc/integration/gutenberg.php
编辑文件内容
<?php namespace TotalTheme\Integration; \defined( 'ABSPATH' ) || exit; /** * Gutenberg Integration Class. */ class Gutenberg { /** * Init. */ public static function init() { \add_action( 'after_setup_theme', [ self::class, 'on_after_setup_theme' ] ); \add_action( 'init', [ self::class, 'on_init' ] ); if ( is_admin() ) { \add_action( 'enqueue_block_assets', [ self::class, 'on_enqueue_block_assets' ] ); } } /** * Runs on the "after_setup_theme" hook. */ public static function on_after_setup_theme(): void { if ( ! self::is_block_editor_enabled() ) { return; } \add_theme_support( 'gutenberg-editor' ); if ( \apply_filters( 'wpex_color_palette_gutenberg_support', true ) ) { Gutenberg\Editor_Color_Palette::register_colors(); } } /** * Runs on the "init" hook. */ public static function on_init(): void { if ( \current_theme_supports( 'gutenberg-editor' ) ) { self::enabled(); } else { self::disabled(); } } /** * Runs when Gutenberg is enabled. */ private static function enabled(): void { totaltheme_init_class( __NAMESPACE__ . '\Gutenberg\Register_Block_Styles' ); if ( \apply_filters( 'wpex_has_block_gallery_lightbox_integration', true ) ) { totaltheme_init_class( __NAMESPACE__ . '\Gutenberg\Block_Gallery_Lightbox' ); } } /** * Runs when Gutenberg is disabled. */ private static function disabled(): void { /** * Filters whether the theme should remove the core Gutenberg styles or not. * * @param bool $check */ $remove_css = (bool) \apply_filters( 'totaltheme/integration/gutenberg/remove_core_styles/enabled', true ); /*** deprecated ***/ $remove_css = (bool) \apply_filters( 'wpex_remove_block_library_css', true ); if ( $remove_css ) { totaltheme_init_class( __NAMESPACE__ . '\Gutenberg\Dequeue_Styles' ); } } /** * Checks if the block editor is enabled. */ public static function is_block_editor_enabled(): bool { $check = true; if ( \class_exists( '\Classic_Editor', false ) || ( \WPEX_VC_ACTIVE && self::wpb_gutenberg_disabled_check() ) ) { $check = false; } return $check; } /** * Runs on the "on_enqueue_block_assets" hook. */ public static function on_enqueue_block_assets() { \wp_enqueue_style( 'wpex-custom-properties', \get_theme_file_uri( '/assets/css/wpex-custom-properties.css' ), [], \WPEX_THEME_VERSION, 'all' ); \wp_enqueue_style( 'wpex-utility', \get_theme_file_uri( '/assets/css/wpex-utility.css' ), [], \WPEX_THEME_VERSION, 'all' ); \wp_style_add_data( 'wpex-utility', 'rtl', 'replace' ); } /** * Checks if the block editor is enabled. */ protected static function wpb_gutenberg_disabled_check(): bool { if ( \get_option( 'wpb_js_gutenberg_disable' ) ) { return true; } return totaltheme_call_static( 'Integration\WPBakery\Slim_Mode', 'is_enabled' ) && totaltheme_call_static( 'Integration\WPBakery\Helpers', 'is_frontend_edit_mode' ); } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件