芝麻web文件管理V1.00
编辑当前文件:/home/freeclou/optimyar/wp-content/plugins/jet-blocks/includes/class-jet-blocks-assets.php
plugin_path( 'assets/css/templates/' . $file_name ) ); $time = $frontend_file->get_meta( 'time' ); if ( ! $time ) { $frontend_file->update(); } $version = get_option( 'jet-blocks-version' ); if ( ! $version || version_compare( $version, jet_blocks()->get_version(), '<' ) ) { $frontend_file->update(); update_option( 'jet-blocks-version', jet_blocks()->get_version(), true ); } $style_url = $frontend_file->get_url(); wp_enqueue_style( 'jet-blocks', $style_url, false, jet_blocks()->get_version() ); } /** * Enqueue plugin scripts only with elementor scripts * * @return void */ public function enqueue_scripts() { $min_suffix = jet_blocks_tools()->is_script_debug() ? '' : '.min'; do_action( 'jet-blocks/frontend/before_enqueue_scripts' ); wp_enqueue_script( 'jet-blocks', jet_blocks()->plugin_url( 'assets/js/jet-blocks' . $min_suffix . '.js' ), array( 'jquery', 'elementor-frontend' ), jet_blocks()->get_version(), true ); $localize_data = apply_filters( 'jet-blocks/frontend/localize-data', array() ); if ( ! empty( $localize_data ) ) { wp_localize_script( 'jet-blocks', 'jetBlocksData', $localize_data ); } $rest_api_url = apply_filters( 'jet-blocks/rest/url', get_rest_url() ); wp_localize_script( 'jet-blocks', 'JetHamburgerPanelSettings', array( 'ajaxurl' => esc_url( admin_url( 'admin-ajax.php' ) ), 'isMobile' => filter_var( wp_is_mobile(), FILTER_VALIDATE_BOOLEAN ) ? 'true' : 'false', 'templateApiUrl' => $rest_api_url . 'jet-blocks-api/v1/elementor-template', 'devMode' => is_user_logged_in() ? 'true' : 'false', 'restNonce' => wp_create_nonce( 'wp_rest' ), ) ); } /** * Enqueue elemnetor editor-related styles * * @return void */ public function editor_styles() { wp_enqueue_style( 'jet-blocks-editor', jet_blocks()->plugin_url( 'assets/css/jet-blocks-editor.css' ), array(), jet_blocks()->get_version() ); } /** * Enqueue plugin scripts only with elementor scripts * * @return void */ public function editor_scripts() { $min_suffix = jet_blocks_tools()->is_script_debug() ? '' : '.min'; wp_enqueue_script( 'jet-blocks-editor', jet_blocks()->plugin_url( 'assets/js/jet-blocks-editor' . $min_suffix . '.js' ), array( 'jquery' ), jet_blocks()->get_version(), true ); } /** * Add responsive css templates. * * @param array $templates CSS templates. * * @return array */ function add_responsive_css_templates( $templates = array() ) { $templates_paths = glob( jet_blocks()->plugin_path( 'assets/css/templates' ) . '*.css' ); foreach ( $templates_paths as $template_path ) { $file_name = 'custom-' . basename( $template_path ); $templates[ $file_name ] = $template_path; } return $templates; } /** * Returns the instance. * * @since 1.0.0 * @return object */ public static function get_instance() { // If the single instance hasn't been set, set it now. if ( null == self::$instance ) { self::$instance = new self; } return self::$instance; } } } /** * Returns instance of Jet_Blocks_Assets * * @return object */ function jet_blocks_assets() { return Jet_Blocks_Assets::get_instance(); }