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


PHP wp_localize_script函数代码示例

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


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

示例1: setup_wizard

 /**
  * Show the setup wizard
  */
 public function setup_wizard()
 {
     if (empty($_GET['page']) || 'wc-setup' !== $_GET['page']) {
         return;
     }
     $this->steps = array('introduction' => array('name' => __('Introduction', 'woocommerce'), 'view' => array($this, 'wc_setup_introduction'), 'handler' => ''), 'pages' => array('name' => __('Page Setup', 'woocommerce'), 'view' => array($this, 'wc_setup_pages'), 'handler' => array($this, 'wc_setup_pages_save')), 'locale' => array('name' => __('Store Locale', 'woocommerce'), 'view' => array($this, 'wc_setup_locale'), 'handler' => array($this, 'wc_setup_locale_save')), 'shipping_taxes' => array('name' => __('Shipping & Tax', 'woocommerce'), 'view' => array($this, 'wc_setup_shipping_taxes'), 'handler' => array($this, 'wc_setup_shipping_taxes_save')), 'payments' => array('name' => __('Payments', 'woocommerce'), 'view' => array($this, 'wc_setup_payments'), 'handler' => array($this, 'wc_setup_payments_save')), 'next_steps' => array('name' => __('Ready!', 'woocommerce'), 'view' => array($this, 'wc_setup_ready'), 'handler' => ''));
     $this->step = isset($_GET['step']) ? sanitize_key($_GET['step']) : current(array_keys($this->steps));
     $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
     wp_register_script('select2', WC()->plugin_url() . '/assets/js/select2/select2' . $suffix . '.js', array('jquery'), '3.5.2');
     wp_register_script('wc-enhanced-select', WC()->plugin_url() . '/assets/js/admin/wc-enhanced-select' . $suffix . '.js', array('jquery', 'select2'), WC_VERSION);
     wp_localize_script('wc-enhanced-select', 'wc_enhanced_select_params', array('i18n_matches_1' => _x('One result is available, press enter to select it.', 'enhanced select', 'woocommerce'), 'i18n_matches_n' => _x('%qty% results are available, use up and down arrow keys to navigate.', 'enhanced select', 'woocommerce'), 'i18n_no_matches' => _x('No matches found', 'enhanced select', 'woocommerce'), 'i18n_ajax_error' => _x('Loading failed', 'enhanced select', 'woocommerce'), 'i18n_input_too_short_1' => _x('Please enter 1 or more characters', 'enhanced select', 'woocommerce'), 'i18n_input_too_short_n' => _x('Please enter %qty% or more characters', 'enhanced select', 'woocommerce'), 'i18n_input_too_long_1' => _x('Please delete 1 character', 'enhanced select', 'woocommerce'), 'i18n_input_too_long_n' => _x('Please delete %qty% characters', 'enhanced select', 'woocommerce'), 'i18n_selection_too_long_1' => _x('You can only select 1 item', 'enhanced select', 'woocommerce'), 'i18n_selection_too_long_n' => _x('You can only select %qty% items', 'enhanced select', 'woocommerce'), 'i18n_load_more' => _x('Loading more results…', 'enhanced select', 'woocommerce'), 'i18n_searching' => _x('Searching…', 'enhanced select', 'woocommerce'), 'ajax_url' => admin_url('admin-ajax.php'), 'search_products_nonce' => wp_create_nonce('search-products'), 'search_customers_nonce' => wp_create_nonce('search-customers')));
     wp_enqueue_style('woocommerce_admin_styles', WC()->plugin_url() . '/assets/css/admin.css', array(), WC_VERSION);
     wp_enqueue_style('wc-setup', WC()->plugin_url() . '/assets/css/wc-setup.css', array('dashicons', 'install'), WC_VERSION);
     wp_register_script('wc-setup', WC()->plugin_url() . '/assets/js/admin/wc-setup.min.js', array('jquery', 'wc-enhanced-select'), WC_VERSION);
     wp_localize_script('wc-setup', 'wc_setup_params', array('locale_info' => json_encode(include WC()->plugin_path() . '/i18n/locale-info.php')));
     if (!empty($_POST['save_step']) && isset($this->steps[$this->step]['handler'])) {
         call_user_func($this->steps[$this->step]['handler']);
     }
     ob_start();
     $this->setup_wizard_header();
     $this->setup_wizard_steps();
     $this->setup_wizard_content();
     $this->setup_wizard_footer();
     exit;
 }
开发者ID:zengskie,项目名称:Heroku-WordPress-PostgreSQL,代码行数:28,代码来源:class-wc-admin-setup-wizard.php

示例2: boas_scripts

 function boas_scripts()
 {
     global $boas_opt;
     //Bootstrap Customized
     wp_enqueue_script('bootstarp', BOAS_ASSETS_URI . '/js/bootstrap.min.js', array('jquery'), BOAS_VAR, FALSE);
     //Icon front
     wp_enqueue_style('font-awesome', BOAS_ASSETS_URI . '/css/font-awesome.min.css', array(), BOAS_VAR);
     wp_enqueue_style('animate.css', BOAS_ASSETS_URI . '/animate.min.css', array(), BOAS_VAR);
     //Page Loader
     //wp_enqueue_style('pageloader-css', BOAS_ASSETS_URI . '/page-loader/css/introLoader.css', array(), '1.6.2');
     //wp_enqueue_script('pageloader-js', BOAS_ASSETS_URI . '/page-loader/jquery.introLoader.pack.min.js', array('jquery'), '1.6.2', FALSE);
     //Mobile MEnu
     wp_enqueue_style('mmenu-style', BOAS_ASSETS_URI . '/css/jquery.mmenu.all.css', array(), BOAS_VAR);
     wp_enqueue_script('mmenu-js', BOAS_ASSETS_URI . '/js/jquery.mmenu.min.all.js', array('jquery'), BOAS_VAR, FALSE);
     // wp_enqueue_script('tubeplayer', BOAS_ASSETS_URI . '/js/jQuery.tubeplayer.min.js', array('jquery'), '5.3.0', FALSE);
     wp_enqueue_style('flexslider-style', BOAS_ASSETS_URI . '/css/flexslider.css', array(), BOAS_VAR);
     wp_enqueue_script('flexslider', BOAS_ASSETS_URI . '/js/jquery.flexslider-min.js', array('jquery'), BOAS_VAR, FALSE);
     //Slider script
     if (!empty($boas_opt['content_load_animae'])) {
         wp_enqueue_script('wow', BOAS_ASSETS_URI . '/js/wow.min.js', array('jquery'), BOAS_VAR, FALSE);
     }
     //wp_enqueue_script('yt', BOAS_ASSETS_URI . '/js/vapi.js', array(''), BOAS_VAR, FALSE);
     //jquery magnific popup
     //wp_enqueue_style('magnific-popup', BOAS_ASSETS_URI . '/css/magnific-popup.css', array(), '1.0.0');
     //wp_enqueue_script('jquery.magnific-popup', BOAS_ASSETS_URI . '/js/jquery.magnific-popup.min.js', array('jquery'), '1.0.0', FALSE);
     wp_enqueue_script('sticky', BOAS_ASSETS_URI . '/js/jquery.stickyNavbar.min.js', array('jquery'), BOAS_VAR, TRUE);
     wp_enqueue_style('boas-style', BOAS_ASSETS_URI . '/css/boas.css', array(), BOAS_VAR);
     wp_enqueue_script('boas-script', BOAS_ASSETS_URI . '/js/boas-script.js', array('jquery'), BOAS_VAR, TRUE);
     wp_localize_script('boas-script', 'boas_obj', array('site_url' => get_site_url(), 'ajaxUrl' => admin_url('ajax.php'), 'mm_theme' => $boas_opt['mobile_menu_theme'], 'mm_show_logo' => $boas_opt['show_logo_sx'] ? TRUE : FALSE, 'mm_logo' => $boas_opt['logo_url_sx']['url']));
 }
开发者ID:anup04sust,项目名称:singlepage.dev,代码行数:30,代码来源:theme-setup.php

示例3: enqueueJavascripts

 public function enqueueJavascripts($pageHookname)
 {
     if ($pageHookname === $this->adminConsolePageHookname) {
         $jsDir = $this->config->getPluginUrl() . '/js';
         $version = $this->config->getVersion();
         $knockoutSuffix = '';
         $suffix = '.min';
         if (defined('WP_DEBUG') && WP_DEBUG) {
             $knockoutSuffix = '.debug';
             $suffix = '';
         }
         wp_register_script('knockout', $jsDir . '/deps/knockout-3.1.0' . $knockoutSuffix . '.js', array(), $version, false);
         wp_enqueue_script('knockout');
         wp_register_script('knockoutValidation', $jsDir . '/deps/knockout.validation' . $suffix . '.js', array('knockout'), $version, false);
         wp_enqueue_script('knockoutValidation');
         wp_register_script('autosize', $jsDir . '/deps/jquery.autosize' . $suffix . '.js', array('jquery'), $version, false);
         wp_enqueue_script('autosize');
         wp_register_script('chamameAdmin', $jsDir . '/admin' . $suffix . '.js', array('jquery', 'knockout', 'knockoutValidation', 'autosize'), $version, false);
         wp_enqueue_script('chamameAdmin');
         $ajaxUrl = str_replace(array('https:', 'http:'), '', admin_url('admin-ajax.php'));
         $token = wp_create_nonce('chamameLiveChat');
         $textDomain = $this->config->getTextDomain();
         wp_localize_script('chamameAdmin', 'chamameParams', array('ajaxUrl' => $ajaxUrl, 'loggedIn' => $this->session->isLoggedIn(), 'conversationId' => $this->session->getActiveConversationId(), 'token' => $token, 'text' => array('error' => __('Something went wrong. Please try again', $textDomain))));
     }
 }
开发者ID:al-mamun,项目名称:chamame-live-chat,代码行数:25,代码来源:ChamameGuiAdmin.php

示例4: wplms_dashboard_template

function wplms_dashboard_template()
{
    if (!is_user_logged_in()) {
        wp_redirect(site_url());
    }
    $template = 'templates/dashboard';
    global $bp;
    if ($bp->current_component == 'dashboard') {
        wp_enqueue_style('wplms-dashboard-css', WPLMS_DASHBOARD_URL . '/css/wplms-dashboard.css', array(), '1.0');
        wp_enqueue_script('wplms-dashboard-js', WPLMS_DASHBOARD_URL . '/js/wplms-dashboard.js', array('jquery', 'jquery-ui-sortable'), '1.0');
        if (is_active_widget(false, false, 'wplms_instructor_dash_stats', true) || is_active_widget(false, false, 'wplms_dash_stats', true)) {
            wp_enqueue_script('wplms-sparkline', WPLMS_DASHBOARD_URL . '/js/jquery.sparkline.min.js', array('jquery'), true);
        }
        if (is_active_widget(false, false, 'wplms_instructor_stats', true) || is_active_widget(false, false, 'wplms_instructor_commission_stats', true) || is_active_widget(false, false, 'wplms_student_stats', true)) {
            wp_enqueue_script('wplms-raphael', WPLMS_DASHBOARD_URL . '/js/raphael-min.js', array('jquery'), true);
            wp_enqueue_script('wplms-morris', WPLMS_DASHBOARD_URL . '/js/morris.min.js', array('jquery'), true);
        }
        $translation_array = array('earnings' => __('Earnings', 'wplms-dashboard'), 'payout' => __('Payout', 'wplms-dashboard'), 'students' => __('# Students', 'wplms-dashboard'), 'saved' => __('SAVED', 'wplms-dashboard'), 'saving' => __('SAVING ...', 'wplms-dashboard'), 'stats_calculated' => __('Stats Calculated, reloading page ...', 'wplms-dashboard'));
        wp_localize_script('wplms-dashboard-js', 'wplms_dashboard_strings', $translation_array);
    }
    $located_template = apply_filters('bp_located_template', locate_template($template, false), $template);
    if ($located_template && $located_template != '') {
        bp_get_template_part(apply_filters('bp_load_template', $located_template));
    } else {
        bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/dashboard'));
    }
}
开发者ID:akshayxhtmljunkies,项目名称:brownglock,代码行数:27,代码来源:functions.php

示例5: render

 /**
  * Field Render Function.
  *
  * Takes the vars and outputs the HTML for the field in the settings
  *
  * @since ReduxFramework 3.0.0
  */
 function render()
 {
     if (empty($this->field['min'])) {
         $this->field['min'] = 0;
     } else {
         $this->field['min'] = intval($this->field['min']);
     }
     if (empty($this->field['max'])) {
         $this->field['max'] = intval($this->field['min']) + 1;
     } else {
         $this->field['max'] = intval($this->field['max']);
     }
     if (empty($this->field['step']) || $this->field['step'] > $this->field['max']) {
         $this->field['step'] = 1;
     } else {
         $this->field['step'] = intval($this->field['step']);
     }
     if (empty($this->value) && !empty($this->field['default']) && intval($this->field['min']) >= 1) {
         $this->value = intval($this->field['default']);
     }
     if (empty($this->value) && intval($this->field['min']) >= 1) {
         $this->value = intval($this->field['min']);
     }
     if (empty($this->value)) {
         $this->value = 0;
     }
     // Extra Validation
     if ($this->value < $this->field['min']) {
         $this->value = intval($this->field['min']);
     } else {
         if ($this->value > $this->field['max']) {
             $this->value = intval($this->field['max']);
         }
     }
     $params = array('id' => '', 'min' => '', 'max' => '', 'step' => '', 'val' => '', 'default' => '');
     $params = wp_parse_args($this->field, $params);
     $params['val'] = $this->value;
     // Don't allow input edit if there's a step
     $readonly = "";
     if (isset($this->field['edit']) && $this->field['edit'] == false) {
         $readonly = ' readonly="readonly"';
     }
     // Use javascript globalization, better than any other method.
     global $wp_scripts;
     $data = $wp_scripts->get_data('redux-field-spinner-js', 'data');
     if (!empty($data)) {
         // Adding to the previous localize script object
         if (!is_array($data)) {
             $data = json_decode(str_replace('var reduxSpinners = ', '', substr($data, 0, -1)), true);
         }
         foreach ($data as $key => $value) {
             $localized_data[$key] = $value;
         }
         $wp_scripts->add_data('redux-field-spinner-js', 'data', '');
     }
     $localized_data[$this->field['id']] = $params;
     wp_localize_script('redux-field-spinner-js', 'reduxSpinners', $localized_data);
     echo '<input type="text" name="' . $this->args['opt_name'] . '[' . $this->field['id'] . ']" id="' . $this->field['id'] . '" value="' . $this->value . '" class="mini spinner-input' . $this->field['class'] . '"' . $readonly . '/>';
     echo '<div id="' . $this->field['id'] . '-spinner" class="redux_spinner" rel="' . $this->field['id'] . '"></div>';
 }
开发者ID:Bitcoinsulting,项目名称:website-ads,代码行数:67,代码来源:field_spinner.php

示例6: admin_enqueue_scripts

 /**
  * Enqueue scripts and styles
  *
  * @return void
  */
 static function admin_enqueue_scripts()
 {
     $url = RWMB_CSS_URL . 'jqueryui';
     wp_register_style('jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17');
     wp_register_style('jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17');
     wp_register_style('jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.css", array('jquery-ui-core', 'jquery-ui-theme'), '1.8.17');
     wp_register_style('jquery-ui-slider', "{$url}/jquery.ui.slider.css", array('jquery-ui-core', 'jquery-ui-theme'), '1.8.17');
     wp_enqueue_style('jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.css", array('jquery-ui-datepicker', 'jquery-ui-slider'), '0.9.7');
     wp_register_script('jquery-ui-timepicker', RWMB_JS_URL . 'jqueryui/jquery-ui-timepicker-addon.js', array('jquery-ui-datepicker', 'jquery-ui-slider'), '0.9.7', true);
     // Load localized scripts
     $locale = str_replace('_', '-', get_locale());
     $date_path = 'jqueryui/datepicker-i18n/jquery.ui.datepicker-' . $locale . '.js';
     $time_path = 'jqueryui/timepicker-i18n/jquery-ui-timepicker-' . $locale . '.js';
     $deps = array('jquery-ui-datepicker', 'jquery-ui-timepicker');
     if (file_exists(RWMB_DIR . 'js/' . $date_path)) {
         wp_register_script('jquery-ui-datepicker-i18n', RWMB_JS_URL . $date_path, array('jquery-ui-datepicker'), '1.8.17', true);
         $deps[] = 'jquery-ui-datepicker-i18n';
     }
     if (file_exists(RWMB_DIR . 'js/' . $time_path)) {
         wp_register_script('jquery-ui-timepicker-i18n', RWMB_JS_URL . $time_path, array('jquery-ui-timepicker'), '1.8.17', true);
         $deps[] = 'jquery-ui-timepicker-i18n';
     }
     wp_enqueue_script('rwmb-datetime', RWMB_JS_URL . 'datetime.js', $deps, RWMB_VER, true);
     wp_localize_script('rwmb-datetime', 'RWMB_Datetimepicker', array('lang' => $locale));
 }
开发者ID:RDePoppe,项目名称:luminaterealestate,代码行数:30,代码来源:datetime.php

示例7: __construct

 /**
  * Constructor
  */
 public function __construct()
 {
     $remove = array_diff(array_keys($_GET), $this->baseUrlParamNames);
     if ($remove) {
         $this->baseUrl = remove_query_arg($remove);
     } else {
         $this->baseUrl = $_SERVER['REQUEST_URI'];
     }
     parent::__construct();
     // add special filter for url fields
     $this->input->addFilter(create_function('$str', 'return "http://" == $str || "ftp://" == $str ? "" : $str;'));
     // enqueue required sripts and styles
     global $wp_styles;
     if (!is_a($wp_styles, 'WP_Styles')) {
         $wp_styles = new WP_Styles();
     }
     wp_enqueue_style('pmwi-admin-style', PMWI_ROOT_URL . '/static/css/admin.css', array(), PMWI_VERSION);
     if (version_compare(get_bloginfo('version'), '3.8-RC1') >= 0) {
         wp_enqueue_style('pmwi-admin-style-wp-3.8', PMWI_ROOT_URL . '/static/css/admin-wp-3.8.css');
     }
     wp_enqueue_script('pmwi-script', PMWI_ROOT_URL . '/static/js/pmwi.js', array('jquery'));
     wp_enqueue_script('pmwi-admin-script', PMWI_ROOT_URL . '/static/js/admin.js', array('jquery', 'jquery-ui-core', 'jquery-ui-resizable', 'jquery-ui-dialog', 'jquery-ui-datepicker', 'jquery-ui-draggable', 'jquery-ui-droppable', 'pmxi-admin-script'), PMWI_VERSION);
     global $woocommerce;
     $woocommerce_witepanel_params = array('remove_item_notice' => __("Remove this item? If you have previously reduced this item's stock, or this order was submitted by a customer, will need to manually restore the item's stock.", 'wpai_woocommerce_addon_plugin'), 'remove_attribute' => __('Remove this attribute?', 'wpai_woocommerce_addon_plugin'), 'name_label' => __('Name', 'wpai_woocommerce_addon_plugin'), 'remove_label' => __('Remove', 'wpai_woocommerce_addon_plugin'), 'click_to_toggle' => __('Click to toggle', 'wpai_woocommerce_addon_plugin'), 'values_label' => __('Value(s)', 'wpai_woocommerce_addon_plugin'), 'text_attribute_tip' => __('Enter some text, or some attributes by pipe (|) separating values.', 'wpai_woocommerce_addon_plugin'), 'visible_label' => __('Visible on the product page', 'wpai_woocommerce_addon_plugin'), 'used_for_variations_label' => __('Used for variations', 'wpai_woocommerce_addon_plugin'), 'new_attribute_prompt' => __('Enter a name for the new attribute term:', 'wpai_woocommerce_addon_plugin'), 'calc_totals' => __("Calculate totals based on order items, discount amount, and shipping? Note, you will need to (optionally) calculate tax rows and cart discounts manually.", 'wpai_woocommerce_addon_plugin'), 'calc_line_taxes' => __("Calculate line taxes? This will calculate taxes based on the customers country. If no billing/shipping is set it will use the store base country.", 'wpai_woocommerce_addon_plugin'), 'copy_billing' => __("Copy billing information to shipping information? This will remove any currently entered shipping information.", 'wpai_woocommerce_addon_plugin'), 'load_billing' => __("Load the customer's billing information? This will remove any currently entered billing information.", 'wpai_woocommerce_addon_plugin'), 'load_shipping' => __("Load the customer's shipping information? This will remove any currently entered shipping information.", 'wpai_woocommerce_addon_plugin'), 'featured_label' => __('Featured', 'wpai_woocommerce_addon_plugin'), 'tax_or_vat' => $woocommerce->countries->tax_or_vat(), 'prices_include_tax' => get_option('woocommerce_prices_include_tax'), 'round_at_subtotal' => get_option('woocommerce_tax_round_at_subtotal'), 'meta_name' => __('Meta Name', 'wpai_woocommerce_addon_plugin'), 'meta_value' => __('Meta Value', 'wpai_woocommerce_addon_plugin'), 'no_customer_selected' => __('No customer selected', 'wpai_woocommerce_addon_plugin'), 'tax_label' => __('Tax Label:', 'wpai_woocommerce_addon_plugin'), 'compound_label' => __('Compound:', 'wpai_woocommerce_addon_plugin'), 'cart_tax_label' => __('Cart Tax:', 'wpai_woocommerce_addon_plugin'), 'shipping_tax_label' => __('Shipping Tax:', 'wpai_woocommerce_addon_plugin'), 'plugin_url' => $woocommerce->plugin_url(), 'ajax_url' => admin_url('admin-ajax.php'), 'add_order_item_nonce' => wp_create_nonce("add-order-item"), 'add_attribute_nonce' => wp_create_nonce("add-attribute"), 'calc_totals_nonce' => wp_create_nonce("calc-totals"), 'get_customer_details_nonce' => wp_create_nonce("get-customer-details"), 'search_products_nonce' => wp_create_nonce("search-products"), 'calendar_image' => $woocommerce->plugin_url() . '/assets/images/calendar.png', 'post_id' => null);
     wp_localize_script('woocommerce_writepanel', 'woocommerce_writepanel_params', $woocommerce_witepanel_params);
     wp_enqueue_style('pmwi-woo-style', $woocommerce->plugin_url() . '/assets/css/admin.css');
 }
开发者ID:soflyy,项目名称:woocommerce-xml-csv-product-import,代码行数:30,代码来源:admin.php

示例8: tp_enqueue_scripts

 /**
  * Đây là function thêm script
  */
 public function tp_enqueue_scripts()
 {
     wp_enqueue_script('tpu-script-uikit', TPU_JS . 'uikit.min.js', array('jquery'), '0.1', false);
     wp_enqueue_script('tpu-script-upload', TPU_JS . 'upload.js', array('jquery'), '0.1', false);
     wp_enqueue_script('tpu-script-main', TPU_JS . 'main.js', array('jquery'), '0.1', true);
     wp_localize_script('tpu-script-main', 'tp_ajax_url', array('ajax_url' => admin_url('admin-ajax.php')));
 }
开发者ID:vuducnam,项目名称:wp-upload-ajax-with-process,代码行数:10,代码来源:wp-upload-ajax-with-process.php

示例9: load_styles_scripts

 /**
  * Styles & Scripts conditional loading
  *
  * @param
  *            $hook
  */
 public function load_styles_scripts()
 {
     $lang = get_bloginfo('language');
     $lang = explode('-', $lang);
     $lang = $lang[0];
     /*
      * Item reports Styles & Scripts
      */
     if (GADWP_Tools::check_roles($this->gadwp->config->options['ga_dash_access_front']) && $this->gadwp->config->options['frontend_item_reports']) {
         wp_enqueue_style('gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.css', null, GADWP_CURRENT_VERSION);
         wp_enqueue_style('gadwp-frontend-item-reports', GADWP_URL . 'front/css/item-reports.css', null, GADWP_CURRENT_VERSION);
         $country_codes = GADWP_Tools::get_countrycodes();
         if ($this->gadwp->config->options['ga_target_geomap'] && isset($country_codes[$this->gadwp->config->options['ga_target_geomap']])) {
             $region = $this->gadwp->config->options['ga_target_geomap'];
         } else {
             $region = false;
         }
         wp_enqueue_style("wp-jquery-ui-dialog");
         if (!wp_script_is('googlejsapi')) {
             wp_register_script('googlejsapi', 'https://www.google.com/jsapi?autoload=%7B%22modules%22%3A%5B%7B%22name%22%3A%22visualization%22%2C%22version%22%3A%221%22%2C%22language%22%3A%22' . $lang . '%22%2C%22packages%22%3A%5B%22corechart%22%2C%20%22table%22%2C%20%22orgchart%22%2C%20%22geochart%22%5D%7D%5D%7D%27', array(), null);
         }
         wp_enqueue_script('gadwp-nprogress', GADWP_URL . 'common/nprogress/nprogress.js', array('jquery'), GADWP_CURRENT_VERSION);
         wp_enqueue_script('gadwp-frontend-item-reports', GADWP_URL . 'common/js/reports.js', array('gadwp-nprogress', 'googlejsapi', 'jquery', 'jquery-ui-dialog'), GADWP_CURRENT_VERSION);
         /* @formatter:off */
         wp_localize_script('gadwp-frontend-item-reports', 'gadwpItemData', array('ajaxurl' => admin_url('admin-ajax.php'), 'security' => wp_create_nonce('gadwp_frontend_item_reports'), 'dateList' => array('today' => __("Today", 'google-analytics-dashboard-for-wp'), 'yesterday' => __("Yesterday", 'google-analytics-dashboard-for-wp'), '7daysAgo' => sprintf(__("Last %d Days", 'google-analytics-dashboard-for-wp'), 7), '14daysAgo' => sprintf(__("Last %d Days", 'google-analytics-dashboard-for-wp'), 14), '30daysAgo' => sprintf(__("Last %d Days", 'google-analytics-dashboard-for-wp'), 30), '90daysAgo' => sprintf(__("Last %d Days", 'google-analytics-dashboard-for-wp'), 90), '365daysAgo' => sprintf(_n("%s Year", "%s Years", 1, 'google-analytics-dashboard-for-wp'), __('One', 'google-analytics-dashboard-for-wp')), '1095daysAgo' => sprintf(_n("%s Year", "%s Years", 3, 'google-analytics-dashboard-for-wp'), __('Three', 'google-analytics-dashboard-for-wp'))), 'reportList' => array('uniquePageviews' => __("Unique Views", 'google-analytics-dashboard-for-wp'), 'users' => __("Users", 'google-analytics-dashboard-for-wp'), 'organicSearches' => __("Organic", 'google-analytics-dashboard-for-wp'), 'pageviews' => __("Page Views", 'google-analytics-dashboard-for-wp'), 'visitBounceRate' => __("Bounce Rate", 'google-analytics-dashboard-for-wp'), 'locations' => __("Location", 'google-analytics-dashboard-for-wp'), 'referrers' => __("Referrers", 'google-analytics-dashboard-for-wp'), 'searches' => __("Searches", 'google-analytics-dashboard-for-wp'), 'trafficdetails' => __("Traffic", 'google-analytics-dashboard-for-wp'), 'technologydetails' => __("Technology", 'google-analytics-dashboard-for-wp')), 'i18n' => array(__("A JavaScript Error is blocking plugin resources!", 'google-analytics-dashboard-for-wp'), __("Traffic Mediums", 'google-analytics-dashboard-for-wp'), __("Visitor Type", 'google-analytics-dashboard-for-wp'), __("Search Engines", 'google-analytics-dashboard-for-wp'), __("Social Networks", 'google-analytics-dashboard-for-wp'), __("Unique Views", 'google-analytics-dashboard-for-wp'), __("Users", 'google-analytics-dashboard-for-wp'), __("Page Views", 'google-analytics-dashboard-for-wp'), __("Bounce Rate", 'google-analytics-dashboard-for-wp'), __("Organic Search", 'google-analytics-dashboard-for-wp'), __("Pages/Session", 'google-analytics-dashboard-for-wp'), __("Invalid response, more details in JavaScript Console (F12).", 'google-analytics-dashboard-for-wp'), __("Not enough data collected", 'google-analytics-dashboard-for-wp'), __("This report is unavailable", 'google-analytics-dashboard-for-wp'), __("report generated by", 'google-analytics-dashboard-for-wp'), __("This plugin needs an authorization:", 'google-analytics-dashboard-for-wp') . ' <strong>' . __("authorize the plugin", 'google-analytics-dashboard-for-wp') . '</strong>!', __("Browser", 'google-analytics-dashboard-for-wp'), __("Operating System", 'google-analytics-dashboard-for-wp'), __("Screen Resolution", 'google-analytics-dashboard-for-wp'), __("Mobile Brand", 'google-analytics-dashboard-for-wp')), 'colorVariations' => GADWP_Tools::variations($this->gadwp->config->options['ga_dash_style']), 'region' => $region, 'language' => get_bloginfo('language'), 'filter' => $_SERVER["REQUEST_URI"], 'viewList' => false, 'scope' => 'front-item'));
         /* @formatter:on */
     }
 }
开发者ID:brstgt,项目名称:layuda,代码行数:34,代码来源:setup.php

示例10: settings_edd_license_activation

 function settings_edd_license_activation($field, $echo)
 {
     wp_enqueue_script('gv-admin-edd-license', GRAVITYVIEW_URL . 'assets/js/admin-edd-license.js', array('jquery'));
     $status = trim($this->Addon->get_app_setting('license_key_status'));
     $key = trim($this->Addon->get_app_setting('license_key'));
     if (!empty($key)) {
         $response = $this->Addon->get_app_setting('license_key_response');
         $response = is_array($response) ? (object) $response : json_decode($response);
     } else {
         $response = array();
     }
     wp_localize_script('gv-admin-edd-license', 'GVGlobals', array('license_box' => $this->get_license_message($response)));
     $fields = array(array('name' => 'edd-activate', 'value' => __('Activate License', 'gravityview'), 'data-pending_text' => __('Verifying license&hellip;', 'gravityview'), 'data-edd_action' => 'activate_license', 'class' => 'button-primary'), array('name' => 'edd-deactivate', 'value' => __('Deactivate License', 'gravityview'), 'data-pending_text' => __('Deactivating license&hellip;', 'gravityview'), 'data-edd_action' => 'deactivate_license', 'class' => empty($status) ? 'button-primary hide' : 'button-primary'), array('name' => 'edd-check', 'value' => __('Check License', 'gravityview'), 'data-pending_text' => __('Verifying license&hellip;', 'gravityview'), 'title' => 'Check the license before saving it', 'data-edd_action' => 'check_license', 'class' => 'button-secondary'));
     $class = 'button gv-edd-action';
     $class .= !empty($key) && $status !== 'valid' ? '' : ' hide';
     $submit = '<div class="gv-edd-button-wrapper">';
     foreach ($fields as $field) {
         $field['type'] = 'button';
         $field['class'] = isset($field['class']) ? $field['class'] . ' ' . $class : $class;
         $field['style'] = 'margin-left: 10px;';
         $submit .= $this->Addon->settings_submit($field, $echo);
     }
     $submit .= '</div>';
     return $submit;
 }
开发者ID:roarmoser,项目名称:gv1,代码行数:25,代码来源:class-gv-license-handler.php

示例11: as_on_add_scripts

function as_on_add_scripts()
{
    // enqueue backbonejs, underscore
    add_existed_script('backbone');
    add_existed_script('underscore');
    if (as_option('as_option_smooth_scroll', '1')) {
        // Smoothscroll
        add_script('smoothscroll', TEMPLATEURL . '/js/smoothscroll.js', array('jquery'));
    }
    // Modernize
    add_script('modernizr', TEMPLATEURL . '/js/libs/modernizr.custom.js', array('jquery'));
    // Classie
    add_script('classie', TEMPLATEURL . '/js/libs/classie.js', array('jquery'));
    if (as_option('as_option_retina_img', '1')) {
        // Retina JS
        add_script('retina', TEMPLATEURL . '/js/libs/retina.min.js', array('jquery'));
    }
    // Dialog
    add_script('dialog', TEMPLATEURL . '/js/libs/dialogFx.js', array('jquery', 'modernizr', 'classie'));
    // Front Js
    add_script('front', TEMPLATEURL . '/js/front.js', array('jquery', 'backbone', 'underscore'));
    wp_localize_script('front', 'as_globals', array('ajaxURL' => admin_url('admin-ajax.php'), 'imgURL' => get_template_directory_uri() . '/img/'));
    // Custom
    add_script('main', TEMPLATEURL . '/js/main.js', array('jquery'));
    add_script('jquery.appear', TEMPLATEURL . '/js/libs/jquery.appear.js', array('jquery', 'main'));
    //video
    add_script('video.js', TEMPLATEURL . '/js/libs/video.js', array('jquery', 'main'));
    //audio
    add_script('audio.js', TEMPLATEURL . '/js/libs/audio.js', array('jquery', 'main'));
}
开发者ID:bibiangel1989,项目名称:vespatour,代码行数:30,代码来源:actions.php

示例12: enqueue_scripts

 public function enqueue_scripts($data)
 {
     wp_register_script('wpml-user-language', ICL_PLUGIN_URL . '/res/js/wpml-user-language.js', array('jquery'));
     $wp_mail_script_data = array('ajax_url' => admin_url('admin-ajax.php'), 'mail' => $data['mail'], 'auto_refresh_page' => $data['auto_refresh_page'], 'nonce' => wp_create_nonce($this->nonce_name));
     wp_localize_script('wpml-user-language', 'wpml_user_language_data', $wp_mail_script_data);
     wp_enqueue_script('wpml-user-language');
 }
开发者ID:SayenkoDesign,项目名称:ividf,代码行数:7,代码来源:class-wpml-user-language-switcher-resources.php

示例13: han_dwa_qa_add_styles_scripts

/**
 * Add styles and scripts
 * @return (void)
 */
function han_dwa_qa_add_styles_scripts()
{
    wp_enqueue_style('dashicons');
    wp_enqueue_style('han_dwa_qa_styles', plugin_dir_url(__FILE__) . 'assets/css/han_dwa_qa_styles.css', null, '1.0.0');
    wp_enqueue_script('han_dwa_qa_scripts', plugin_dir_url(__FILE__) . 'assets/js/han_dwa_qa_scripts.js', array('jquery'), '1.0.0');
    wp_localize_script('han_dwa_qa_scripts', 'han_dwa_qa_ajax_object', array('ajax_url' => admin_url('admin-ajax.php')));
}
开发者ID:sjorsroelofs,项目名称:han-dwa-qa,代码行数:11,代码来源:han-dwa-qa.php

示例14: tshirt_designer_init_scripts

function tshirt_designer_init_scripts()
{
    $tshirt_designer_sticker_size = get_option('tshirt_designer_sticker_size');
    if (empty($tshirt_designer_sticker_size)) {
        $tshirt_designer_sticker_size = intval(2 * 1000 * 1000);
    } else {
        $tshirt_designer_sticker_size = intval($tshirt_designer_sticker_size * 1000 * 1000);
    }
    wp_enqueue_script('jquery');
    wp_enqueue_script('jquery-ui-core');
    wp_enqueue_script('jquery-ui-widget');
    wp_enqueue_script('jquery-ui-mouse');
    wp_enqueue_script('jquery-ui-draggable');
    wp_enqueue_script('jquery-ui-resizable');
    wp_enqueue_style('jquery-ui.css', tshirt_designer_plugin_url . 'css/jquery-ui.css');
    wp_enqueue_script('html2canvas.js', plugins_url('/js/html2canvas.js', __FILE__), array('jquery'), '1.0', false);
    //wp_enqueue_script( 'circletype.js', plugins_url( '/js/circletype.js', __FILE__ ), array('jquery'), '1.0', false);
    wp_enqueue_script('jscolor.js', plugins_url('/js/jscolor.js', __FILE__), array('jquery'), '1.0', false);
    wp_enqueue_script('tshirt_designer_js', plugins_url('/js/scripts.js', __FILE__), array('jquery'));
    wp_localize_script('tshirt_designer_js', 'tshirt_designer_ajax', array('tshirt_designer_ajaxurl' => admin_url('admin-ajax.php')));
    wp_enqueue_style('tshirt_designer_style', tshirt_designer_plugin_url . 'css/style.css');
    wp_enqueue_style('wp-color-picker');
    wp_enqueue_script('tshirt_designer_color_picker', plugins_url('/js/color-picker.js', __FILE__), false, true);
    //ParaAdmin
    wp_enqueue_style('ParaAdmin', tshirt_designer_plugin_url . 'ParaAdmin/css/ParaAdmin.css');
    //wp_enqueue_style('ParaDashboard', tshirt_designer_plugin_url.'ParaAdmin/css/ParaDashboard.css');
    //wp_enqueue_style('ParaIcons', tshirt_designer_plugin_url.'ParaAdmin/css/ParaIcons.css');
    wp_enqueue_script('ParaAdmin', plugins_url('ParaAdmin/js/ParaAdmin.js', __FILE__), array('jquery'));
    wp_enqueue_script('plupload-handlers');
    wp_enqueue_script('sticker_upload', tshirt_designer_plugin_url . 'js/upload-sticker.js', array('jquery'));
    wp_localize_script('sticker_upload', 'sticker_upload', array('ajaxurl' => admin_url('admin-ajax.php'), 'nonce' => wp_create_nonce('sticker_upload'), 'remove' => wp_create_nonce('sticker_remove'), 'number' => 5, 'upload_enabled' => true, 'confirmMsg' => __('Are you sure you want to delete this?'), 'plupload' => array('runtimes' => 'html5,flash,html4', 'browse_button' => 'sticker-uploader', 'container' => 'sticker-upload-container', 'file_data_name' => 'sticker_upload_file', 'max_file_size' => $tshirt_designer_sticker_size . 'b', 'url' => admin_url('admin-ajax.php') . '?action=sticker_upload&nonce=' . wp_create_nonce('sticker_allow'), 'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'), 'filters' => array(array('title' => __('Allowed Files'), 'extensions' => 'gif,png')), 'multipart' => true, 'urlstream_upload' => true)));
}
开发者ID:riddbengkok,项目名称:tshirt-designer,代码行数:32,代码来源:tshirt-designer.php

示例15: admin_enqueue_scripts

 /**
  * Enqueue scripts and styles
  *
  * @return    void
  */
 static function admin_enqueue_scripts()
 {
     $url = RWMB_CSS_URL . 'jqueryui';
     wp_register_style('jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17');
     wp_register_style('jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17');
     wp_register_style('jquery-ui-datepicker', "{$url}/jquery.ui.datepicker.css", array('jquery-ui-core', 'jquery-ui-theme'), '1.8.17');
     wp_register_style('jquery-ui-slider', "{$url}/jquery.ui.slider.css", array('jquery-ui-core', 'jquery-ui-theme'), '1.8.17');
     wp_enqueue_style('jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.css", array('jquery-ui-datepicker', 'jquery-ui-slider'), '0.9.7');
     $url = RWMB_JS_URL . 'jqueryui';
     wp_register_script('jquery-ui-timepicker', "{$url}/jquery-ui-timepicker-addon.js", array('jquery-ui-datepicker', 'jquery-ui-slider'), '0.9.7', true);
     $deps = array('jquery-ui-timepicker');
     $locale = str_replace('_', '-', get_locale());
     $timepicker_locale_js_url = '';
     if (file_exists(RWMB_DIR . "js/jqueryui/timepicker-i18n/jquery-ui-timepicker-{$locale}.js")) {
         $timepicker_locale_js_url = "{$url}/timepicker-i18n/jquery-ui-timepicker-{$locale}.js";
     } elseif (strlen($locale) > 2 && file_exists(RWMB_DIR . 'js/jqueryui/timepicker-i18n/jquery-ui-timepicker-' . substr($locale, 0, 2) . '.js')) {
         $timepicker_locale_js_url = "{$url}/timepicker-i18n/jquery-ui-timepicker-" . substr($locale, 0, 2) . '.js';
     }
     if ($timepicker_locale_js_url) {
         wp_register_script('jquery-ui-timepicker-i18n', $timepicker_locale_js_url, array('jquery-ui-timepicker'), '0.9.7', true);
         $deps = array('jquery-ui-timepicker-i18n');
     }
     wp_enqueue_script('rwmb-time', RWMB_JS_URL . 'time.js', $deps, RWMB_VER, true);
     wp_localize_script('rwmb-time', 'RWMB_Timepicker', array('lang' => $locale));
 }
开发者ID:sammyboy45467,项目名称:wp-theme,代码行数:30,代码来源:time.php


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