当前位置: 首页>>代码示例>>PHP>>正文


PHP yit_load_js_file函数代码示例

本文整理汇总了PHP中yit_load_js_file函数的典型用法代码示例。如果您正苦于以下问题:PHP yit_load_js_file函数的具体用法?PHP yit_load_js_file怎么用?PHP yit_load_js_file使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了yit_load_js_file函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: enqueue_scripts

 /**
  * Enqueue Scripts
  *
  * Register and enqueue scripts for Frontend
  *
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
  * @since 1.0
  * @return void
  */
 public function enqueue_scripts()
 {
     /* === Style === */
     wp_enqueue_style('yith-wcms-checkout', YITH_WCMS_ASSETS_URL . 'css/frontend.css', array(), '1.0.0');
     /* === Script === */
     $script = apply_filters('yith_wcms_main_script', 'multistep.js');
     $script = function_exists('yit_load_js_file') ? yit_load_js_file($script) : str_replace('.js', '.min.js', $script);
     wp_register_script('yith-wcms-step', YITH_WCMS_ASSETS_URL . 'js/' . $script, array('wc-checkout'), '1.0.1', true);
     wp_enqueue_script('yith-wcms-step');
     do_action('yith_wcms_enqueue_scripts');
 }
开发者ID:patrickcurl,项目名称:monks,代码行数:20,代码来源:class.yith-multistep-checkout-frontend.php

示例2: pointer_load


//.........这里部分代码省略.........
                         /**
                          * Add the pointer to $valid_pointers array
                          */
                         $pointer['pointer_id'] = $point_id;
                         $valid_pointers['pointers'][] = $pointer;
                         $show = true;
                     }
                     break;
                 }
             }
         } else {
             if ($is_multi_activate || $is_multi_upgrade) {
                 /**
                  * Bulk Action: multi plugins activation
                  * Bulk Action: multi plugins update
                  */
                 $point_id = array();
                 $screen_id = $screen->id;
                 if ($is_multi_upgrade && isset($_POST['checked']) && count($_POST['checked']) > 0) {
                     $recently_activate = $_POST['checked'];
                     $screen_id = 'update';
                     $pointers = apply_filters("yit_pointers-{$screen_id}", array());
                 }
                 foreach ($registered as $init => $p_id) {
                     if (in_array($init, $recently_activate)) {
                         $point_id[] = $p_id;
                     }
                 }
                 /**
                  * Bulk Action: Activate Plugins
                  *
                  * count( $point_id ) is the number of YITH plugins that have registered specific pointers
                  * case 0   -> No pointers -> Exit
                  * case 1   -> Only one pointers to show -> Use the specific plugin pointer
                  * defautl  -> Two or more plugins need to show a pointer -> use a generic pointers
                  *
                  */
                 switch (count($point_id)) {
                     case 0:
                         $show = false;
                         break;
                     case 1:
                         $point_id = array_pop($point_id);
                         $pointer = $pointers[$point_id];
                         /**
                          * Sanity check
                          */
                         if (!(in_array($point_id, $dismissed) || empty($pointer) || empty($point_id) || empty($pointer['target']) || empty($pointer['options']))) {
                             /**
                              * Add the pointer to $valid_pointers array
                              */
                             $pointer['pointer_id'] = $point_id;
                             $valid_pointers['pointers'][] = $pointer;
                             $show = true;
                         }
                         break;
                     default:
                         $valid_pointers['pointers'][] = $this->_default_pointer[$screen_id];
                         $show = true;
                         break;
                 }
             }
         }
         update_option('yit_recently_activated', array());
         if (!$show) {
             return;
         }
     } else {
         /**
          * Check pointers and remove dismissed ones.
          */
         foreach ($pointers as $pointer_id => $pointer) {
             /**
              * Sanity check
              */
             if (in_array($pointer_id, $dismissed) || empty($pointer) || empty($pointer_id) || empty($pointer['target']) || empty($pointer['options'])) {
                 continue;
             }
             $pointer['pointer_id'] = $pointer_id;
             /**
              * Add the pointer to $valid_pointers array
              */
             $valid_pointers['pointers'][] = $pointer;
         }
     }
     /**
      * No valid pointers? Stop here.
      */
     if (empty($valid_pointers)) {
         return;
     }
     $script_file = function_exists('yit_load_js_file') ? yit_load_js_file('yit-wp-pointer.js') : 'yit-wp-pointer.min.js';
     /**
      * Enqueue wp-pointer script and style
      */
     wp_enqueue_style('wp-pointer');
     wp_enqueue_script('wp-pointer');
     wp_enqueue_script('yit-wp-pointer', YIT_CORE_PLUGIN_URL . '/assets/js/' . $script_file, array('wp-pointer'), false, true);
     wp_localize_script('yit-wp-pointer', 'custom_pointer', $valid_pointers);
 }
开发者ID:javipaur,项目名称:TiendaVirtual,代码行数:101,代码来源:yit-pointers.php

示例3: admin_enqueue_scripts

 /**
  * Admin Enqueue Scripts
  *
  * @return void
  *
  * @since  1.0
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
  */
 public function admin_enqueue_scripts()
 {
     /**
      * Support to YIT Framework < 2.0
      */
     $filename = function_exists('yit_load_js_file') ? yit_load_js_file('yit-licence.js') : 'yit-licence.js';
     $script_path = defined('YIT_CORE_PLUGIN_URL') ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
     $style_path = defined('YIT_CORE_PLUGIN_URL') ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
     wp_enqueue_script('yit-licence', $script_path . '/licence/assets/js/' . $filename, array('jquery'), '1.0.0', true);
     wp_enqueue_style('yit-theme-licence', $style_path . '/licence/assets/css/yit-licence.css');
 }
开发者ID:NgocSon2412,项目名称:website_banhang,代码行数:19,代码来源:yit-licence.php

示例4: enqueue

 /**
  * Enqueue script and styles in admin side
  *
  * Add style and scripts to administrator
  *
  * @return void
  * @since    1.0
  * @author   Emanuela Castorina <emanuela.castorina@yithemes.it>
  */
 public function enqueue()
 {
     wp_enqueue_media();
     wp_enqueue_style('wp-color-picker');
     wp_enqueue_style('yit-plugin-metaboxes', YIT_CORE_PLUGIN_URL . '/assets/css/metaboxes.css');
     wp_enqueue_style('jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/css/chosen/chosen.css');
     wp_enqueue_script('jquery-ui-datepicker');
     wp_enqueue_script('yit-spinner', YIT_CORE_PLUGIN_URL . '/assets/js/panel.spinner.js', array('jquery'), '0.0.1', true);
     wp_enqueue_script('jquery-chosen', YIT_CORE_PLUGIN_URL . '/assets/js/chosen/chosen.jquery.js', array('jquery'), '1.1.0', true);
     wp_enqueue_script('ajax-chosen', yit_load_js_file(YIT_CORE_PLUGIN_URL . '/assets/js/chosen/ajax-chosen.jquery.js'), array('jquery'), '1.1.0', true);
     wp_enqueue_script('yit-metabox', YIT_CORE_PLUGIN_URL . '/assets/js/metabox.js', array('jquery', 'wp-color-picker'), '1.0.0', true);
     wp_enqueue_style('jquery-ui-overcast', YIT_CORE_PLUGIN_URL . '/assets/css/overcast/jquery-ui-1.8.9.custom.css', false, '1.8.9', 'all');
 }
开发者ID:rinodung,项目名称:live-theme,代码行数:22,代码来源:yit-metabox.php

示例5: admin_enqueue_scripts

 /**
  * Admin Enqueue Scripts
  *
  * @return void
  *
  * @since  1.0
  * @author Andrea Grillo <andrea.grillo@yithemes.com>
  */
 public function admin_enqueue_scripts()
 {
     /**
      * Support to YIT Framework < 2.0
      */
     $filename = function_exists('yit_load_js_file') ? yit_load_js_file('yit-licence.js') : 'yit-licence.js';
     $script_path = defined('YIT_CORE_PLUGIN_URL') ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
     $style_path = defined('YIT_CORE_PLUGIN_URL') ? YIT_CORE_PLUGIN_URL : get_template_directory_uri() . '/core/plugin-fw';
     wp_enqueue_script('yit-licence', $script_path . '/licence/assets/js/' . $filename, array('jquery'), '1.0.0', true);
     wp_enqueue_style('yit-theme-licence', $style_path . '/licence/assets/css/yit-licence.css');
     /* Localize Scripts */
     wp_localize_script('yit-licence', 'licence_message', array('error' => sprintf(_x('%s field cannot be empty', '%s = field name', 'yith-plugin-fw'), '%field%'), 'errors' => sprintf(__('%s and %s fields cannot be empty', 'yith-plugin-fw'), '%field_1%', '%field_2%'), 'server' => __('Unable to contact the remote server, please try again later. Thanks!', 'yith-plugin-fw'), 'email' => __('Email', 'yith-plugin-fw'), 'license_key' => __('License Key', 'yith-plugin-fw'), 'are_you_sure' => __('Are you sure you want to deactivate the license for current site?', 'yith-plugin-fw')));
     wp_localize_script('yit-licence', 'script_info', array('is_debug' => defined('YIT_LICENCE_DEBUG') && YIT_LICENCE_DEBUG));
 }
开发者ID:lieison,项目名称:IndustriasFenix,代码行数:22,代码来源:yit-licence.php

示例6: enqueue_scripts

 /**
  * Enqueue Style and Scripts
  *
  * @return   void
  * @since    1.0
  * @author   Andrea Grillo <andrea.grillo@yithemes.com>
  * @fire yith_wpv_stylesheet_paths The stylesheet paths
  */
 public function enqueue_scripts()
 {
     /* === Main Stylesheet === */
     wp_enqueue_style('yith-wc-product-vendors', YITH_WPV_ASSETS_URL . 'css/product-vendors.css');
     /* === Theme Stylesheet === */
     $paths = apply_filters('yith_wpv_stylesheet_paths', array(WC()->template_path() . 'product-vendors.css', 'product-vendors.css'));
     $located = locate_template($paths, false, false);
     $search = array(get_stylesheet_directory(), get_template_directory());
     $replace = array(get_stylesheet_directory_uri(), get_template_directory_uri());
     if (!empty($located)) {
         $theme_stylesheet = str_replace($search, $replace, $located);
         wp_enqueue_style('yith-wc-product-vendors-theme', $theme_stylesheet);
     }
     /* === Font Awesome Sylesheet === */
     wp_enqueue_style('font-awesome', YITH_WPV_ASSETS_URL . 'third-party/font-awesome/css/font-awesome.min.css');
     /* === Scripts === */
     wp_register_script('imagesloaded', YITH_WPV_ASSETS_URL . 'third-party/imagesloaded/imagesloaded.pkgd.min.js', array('jquery'), '3.1.8', true);
     wp_register_script('gmaps-api', '//maps.google.com/maps/api/js?sensor=false&amp;language=en', array('jquery'));
     wp_register_script('gmap3', YITH_WPV_ASSETS_URL . 'third-party/gmap3/gmap3.min.js', array('jquery', 'gmaps-api'), '6.0.0', false);
     if ($this->is_vendor_page()) {
         wp_enqueue_script('gmap3');
     }
     /* Add PrettyPhoto if WooCommerce Lightbox is disabled and Report Abuse link activated */
     $show_report_abuse = 'none' != get_option('yith_wpv_report_abuse_link_text') ? true : false;
     if ($show_report_abuse && 'no' === get_option('woocommerce_enable_lightbox')) {
         $wc_assets_path = str_replace(array('http:', 'https:'), '', WC()->plugin_url()) . '/assets/';
         $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
         wp_enqueue_script('prettyPhoto', $wc_assets_path . 'js/prettyPhoto/jquery.prettyPhoto' . $suffix . '.js', array('jquery'), '3.1.5', true);
         wp_enqueue_style('woocommerce_prettyPhoto_css', $wc_assets_path . 'css/prettyPhoto.css');
     }
     if ($show_report_abuse) {
         $args = array('ajaxurl' => admin_url('admin-ajax.php'), 'messages' => array('success' => __('Abuse reported correctly.', 'yith_wc_product_vendors'), 'empty' => __('All fields are mandatory.', 'yith_wc_product_vendors'), 'failed' => __('Your request could not be processed. Please try again', 'yith_wc_product_vendors')), 'classes' => array('success' => 'woocommerce-message', 'failed' => 'woocommerce-error', 'empty' => 'woocommerce-info'));
         wp_enqueue_script('yith-wpv-prettyPhoto-init', YITH_WPV_ASSETS_URL . 'js/init.prettyPhoto.js', array('jquery', 'prettyPhoto'), '1.0', true);
         wp_localize_script('yith-wpv-prettyPhoto-init', 'report_abuse', $args);
     }
     $js_file = function_exists('yit_load_js_file') ? yit_load_js_file('multi-vendor.js') : 'multi-vendor.min.js';
     wp_enqueue_script('product-vendors', YITH_WPV_ASSETS_URL . 'js/' . $js_file, array('jquery', 'imagesloaded'), '1.0', true);
     wp_localize_script('product-vendors', 'field_check', array('is_vat_require' => YITH_Vendors()->is_vat_require()));
 }
开发者ID:shwetadubey,项目名称:upfit,代码行数:47,代码来源:class.yith-vendors-frontend-premium.php


注:本文中的yit_load_js_file函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。