芝麻web文件管理V1.00
编辑当前文件:/home/dcqnetm/int/wp-content/plugins/ocean-extra/includes/preloader/preloader.php
preloader_setup(); $this->active = get_theme_mod( 'ocean_preloader_enable', false ); $this->type = get_theme_mod( 'ocean_preloader_type', 'default' ); $this->icon_type = get_theme_mod( 'ocean_preloader_icon_type', 'css' ); $this->icon = get_theme_mod( 'ocean_preloader_default_icon', 'roller' ); $this->template_id = get_theme_mod( 'ocean_preloader_template' ); if ( $this->active ) { add_filter( 'body_class', array( $this, 'preloader_body_class' ) ); add_action( 'wp_head', array( $this, 'preloader_view' ), 1000 ); add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_assets' ) ); add_action( 'ocean_preloader', array( $this, 'render_preloader' ) ); } } /** * Preloader setup */ public function preloader_setup() { require_once OE_PATH . '/includes/preloader/helper.php'; } public function enqueue_assets() { wp_enqueue_style( 'owp-preloader', OE_URL . 'includes/preloader/assets/css/preloader.min.css', array(), OE_VERSION ); if ( 'default' === $this->type && 'css' === $this->icon_type && $this->icon ) { wp_enqueue_style( 'owp-preloader-icon', OE_URL . 'includes/preloader/assets/css/styles/' . $this->icon . '.css', array(), OE_VERSION ); } if ( is_customize_preview() ) { wp_enqueue_script( 'owp-preloader', OE_URL . 'includes/preloader/assets/js/preloader.min.js', array( 'jquery' ), OE_VERSION, false ); wp_localize_script( 'owp-preloader', 'owpPreloader', array( 'nonce' => wp_create_nonce( 'oceanwp_preloader' ), ) ); } else { wp_enqueue_script( 'owp-preloader', OE_URL . 'includes/preloader/assets/js/preloader.min.js', array( 'jquery' ), OE_VERSION, false ); wp_localize_script( 'owp-preloader', 'owpPreloader', array( 'nonce' => wp_create_nonce( 'oceanwp_preloader' ), ) ); } // Check if page is Elementor page. $elementor = get_post_meta( $this->template_id, '_elementor_edit_mode', true ); // Elementor css load if ( true === get_theme_mod( 'ocean_preloader_elementor_fouc', true ) && $elementor ) { if ( ! class_exists( '\Elementor\Core\Files\CSS\Post' ) ) { return; } $css_file = new \Elementor\Core\Files\CSS\Post( $this->template_id ); $css_file->enqueue(); } } /** * Preloader view */ public function preloader_body_class( $classes ) { $classes[] = 'ocean-preloader--active'; return $classes; } /** * Preloader view */ public function preloader_view() { ob_start(); ?>
template_id, '_elementor_edit_mode', true ); // Get content if ( ! empty( $this->template_id ) ) { $post_data = get_post( $this->template_id ); if ( $post_data && ! is_wp_error( $post_data ) ) { $get_content = $post_data->post_content; } } if ( 'default' === $this->type ) { ?>
icon_type ) : ?>
icon ) ); ?>
icon_type ) : ?>
icon_type ) : ?>
icon_type ) : ?>
type ) { if ( class_exists( 'Elementor\Plugin' ) && $elementor ) { echo Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $this->template_id ); } // If Beaver Builder. else if ( class_exists( 'FLBuilder' ) && ! empty( $this->template_id ) ) { echo do_shortcode( '[fl_builder_insert_layout id="' . $this->template_id . '"]' ); } // if SiteOrigin. else if ( class_exists( 'SiteOrigin_Panels' ) && get_post_meta( $this->template_id, 'panels_data', true ) ) { echo SiteOrigin_Panels::renderer()->render( $this->template_id ); } // Else else { // If Gutenberg. if ( ocean_is_block_template( $this->template_id ) ) { $get_content = apply_filters( 'ocean_preloader_template_content', do_blocks( $get_content ) ); } // Display template content. echo do_shortcode( $get_content ); } } } } new Ocean_Preloader();