當前位置: 首頁>>代碼示例>>PHP>>正文


PHP nxt_enqueue_script函數代碼示例

本文整理匯總了PHP中nxt_enqueue_script函數的典型用法代碼示例。如果您正苦於以下問題:PHP nxt_enqueue_script函數的具體用法?PHP nxt_enqueue_script怎麽用?PHP nxt_enqueue_script使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了nxt_enqueue_script函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: admin_load

 /**
  * Set up the enqueue for the CSS & JavaScript files.
  *
  * @since 3.0.0
  */
 function admin_load()
 {
     get_current_screen()->add_help_tab(array('id' => 'overview', 'title' => __('Overview'), 'content' => '<p>' . __('You can customize the look of your site without touching any of your theme&#8217;s code by using a custom background. Your background can be an image or a color.') . '</p>' . '<p>' . __('To use a background image, simply upload it, then choose your display options below. You can display a single instance of your image, or tile it to fill the screen. You can have your background fixed in place, so your site content moves on top of it, or you can have it scroll with your site.') . '</p>' . '<p>' . __('You can also choose a background color. If you know the hexadecimal code for the color you want, enter it in the Background Color field. If not, click on the Select a Color link, and a color picker will allow you to choose the exact shade you want.') . '</p>' . '<p>' . __('Don&#8217;t forget to click on the Save Changes button when you are finished.') . '</p>'));
     get_current_screen()->set_help_sidebar('<p><strong>' . __('For more information:') . '</strong></p>' . '<p>' . __('<a href="http://codex.nxtclass.org/Appearance_Background_Screen" target="_blank">Documentation on Custom Background</a>') . '</p>' . '<p>' . __('<a href="http://nxtclass.org/support/" target="_blank">Support Forums</a>') . '</p>');
     nxt_enqueue_script('custom-background');
     nxt_enqueue_style('farbtastic');
 }
開發者ID:nxtclass,項目名稱:NXTClass,代碼行數:12,代碼來源:custom-background.php

示例2: init_scripts

 /**
  */
 public function init_scripts()
 {
     parent::init_scripts();
     if (is_admin()) {
         nxt_enqueue_script('jquery-jstree');
     }
 }
開發者ID:nxtclass,項目名稱:NXTClass-themes,代碼行數:9,代碼來源:class.php

示例3: woo_load_tumblog_libraries

function woo_load_tumblog_libraries()
{
    nxt_enqueue_script('newscript', get_template_directory_uri() . '/functions/js/tumblog-ajax.js', array('jquery', 'jquery-form'));
    nxt_enqueue_script('nicedit', get_template_directory_uri() . '/functions/js/nicEdit.js');
    nxt_enqueue_script('phpjs', get_template_directory_uri() . '/functions/js/php.js');
    nxt_enqueue_script('datepicker', get_template_directory_uri() . '/functions/js/ui.datepicker.js', array('jquery'));
}
開發者ID:nxtclass,項目名稱:NXTClass-themes,代碼行數:7,代碼來源:admin-tumblog-quickpress.php

示例4: members_admin_enqueue_scripts

/**
 * Loads the admin JavaScript for the required pages based off the $hook_suffix parameter.
 *
 * @since 0.2.0
 * @param string $hook_suffix The hook for the current page in the admin.
 */
function members_admin_enqueue_scripts($hook_suffix)
{
    $pages = array('users_page_roles', 'users_page_role-new');
    if (in_array($hook_suffix, $pages)) {
        nxt_enqueue_script('members-admin', trailingslashit(MEMBERS_URI) . 'js/admin.js', array('jquery'), '20110525', true);
    }
}
開發者ID:nxtclass,項目名稱:NXTClass,代碼行數:13,代碼來源:admin.php

示例5: et_ptemplate_upload_categories_scripts

function et_ptemplate_upload_categories_scripts($hook_suffix)
{
    if (in_array($hook_suffix, array('post.php', 'post-new.php'))) {
        nxt_register_script('et-ptemplates', get_template_directory_uri() . '/epanel/page_templates/js/et-ptemplates.js', array('jquery'));
        nxt_enqueue_script('et-ptemplates');
    }
}
開發者ID:nxtclass,項目名稱:NXTClass-themes,代碼行數:7,代碼來源:page_templates.php

示例6: initialize

 public function initialize()
 {
     $this->user = new stdClass();
     if (is_user_logged_in()) {
         /* Populate settings we need for the menu based on the current user. */
         $this->user->blogs = get_blogs_of_user(get_current_user_id());
         if (is_multisite()) {
             $this->user->active_blog = get_active_blog_for_user(get_current_user_id());
             $this->user->domain = empty($this->user->active_blog) ? user_admin_url() : trailingslashit(get_home_url($this->user->active_blog->blog_id));
             $this->user->account_domain = $this->user->domain;
         } else {
             $this->user->active_blog = $this->user->blogs[get_current_blog_id()];
             $this->user->domain = trailingslashit(home_url());
             $this->user->account_domain = $this->user->domain;
         }
     }
     add_action('nxt_head', 'nxt_admin_bar_header');
     add_action('admin_head', 'nxt_admin_bar_header');
     if (current_theme_supports('admin-bar')) {
         $admin_bar_args = get_theme_support('admin-bar');
         // add_theme_support( 'admin-bar', array( 'callback' => '__return_false') );
         $header_callback = $admin_bar_args[0]['callback'];
     }
     if (empty($header_callback)) {
         $header_callback = '_admin_bar_bump_cb';
     }
     add_action('nxt_head', $header_callback);
     nxt_enqueue_script('admin-bar');
     nxt_enqueue_style('admin-bar');
     do_action('admin_bar_init');
 }
開發者ID:nxtclass,項目名稱:NXTClass,代碼行數:31,代碼來源:class-nxt-admin-bar.php

示例7: optionsframework_mlu_js

 function optionsframework_mlu_js()
 {
     // Registers custom scripts for the Media Library AJAX uploader.
     nxt_register_script('of-medialibrary-uploader', OPTIONS_FRAMEWORK_DIRECTORY . 'js/of-medialibrary-uploader.js', array('jquery', 'thickbox'));
     nxt_enqueue_script('of-medialibrary-uploader');
     nxt_enqueue_script('media-upload');
 }
開發者ID:nxtclass,項目名稱:NXTClass-themes,代碼行數:7,代碼來源:options-medialibrary-uploader.php

示例8: woothemes_mlu_js

 function woothemes_mlu_js()
 {
     // Register custom scripts for the Media Library AJAX uploader.
     nxt_register_script('woo-medialibrary-uploader', get_template_directory_uri() . '/functions/js/woo-medialibrary-uploader.js', array('jquery', 'thickbox'));
     nxt_enqueue_script('woo-medialibrary-uploader');
     nxt_enqueue_script('media-upload');
 }
開發者ID:nxtclass,項目名稱:NXTClass-themes,代碼行數:7,代碼來源:admin-medialibrary-uploader.php

示例9: woothemes_add_javascript

 function woothemes_add_javascript()
 {
     global $woo_options;
     nxt_register_script('slides', get_template_directory_uri() . '/includes/js/slides.min.jquery.js', array('jquery'));
     nxt_register_script('prettyPhoto', get_template_directory_uri() . '/includes/js/jquery.prettyPhoto.js', array('jquery'));
     nxt_register_script('jCarousel', get_template_directory_uri() . '/includes/js/jquery.jcarousel.min.js', array('jquery'));
     nxt_register_script('portfolio', get_template_directory_uri() . '/includes/js/portfolio.js', array('jquery', 'prettyPhoto', 'jCarousel', 'slides'));
     nxt_register_script('woo-feedback', get_template_directory_uri() . '/includes/js/feedback.js', array('jquery', 'slides'));
     // Load the prettyPhoto JavaScript and CSS for use on the portfolio page template.
     if (is_page_template('template-portfolio.php') || is_front_page() || is_singular() && get_post_type() == 'portfolio' || is_tax('portfolio-gallery')) {
         nxt_enqueue_script('portfolio');
     }
     // Conditionally load the Feedback JavaScript, where needed.
     $load_feedback_js = false;
     if (is_page_template('template-feedback.php')) {
         $load_feedback_js = true;
     }
     // Allow child themes/plugins to load the Feedback JavaScript when they need it.
     $load_feedback_js = apply_filters('woo_load_feedback_js', $load_feedback_js);
     if ($load_feedback_js) {
         nxt_enqueue_script('woo-feedback');
     }
     do_action('woothemes_add_javascript');
     $general_dependencies = array('jquery');
     if (is_singular()) {
         $general_dependencies[] = 'jquery-ui-tabs';
     }
     nxt_enqueue_script('general', get_template_directory_uri() . '/includes/js/general.js', $general_dependencies);
     // Load the JavaScript for the slides and testimonals on the homepage.
     if (is_home()) {
         nxt_enqueue_script('slides');
         // Load the custom slider settings.
         $autoStart = false;
         $autoSpeed = 6;
         $slideSpeed = 0.5;
         $effect = 'slide';
         $nextprev = 'true';
         $pagination = 'true';
         $hoverpause = 'true';
         $autoheight = 'false';
         // Get our values from the database and, if they're there, override the above defaults.
         $fields = array('autoStart' => 'auto', 'autoSpeed' => 'interval', 'slideSpeed' => 'speed', 'effect' => 'effect', 'nextprev' => 'nextprev', 'pagination' => 'pagination', 'hoverpause' => 'hover', 'autoHeight' => 'autoheight');
         foreach ($fields as $k => $v) {
             if (is_array($woo_options) && isset($woo_options['woo_slider_' . $v]) && $woo_options['woo_slider_' . $v] != '') {
                 ${$k} = $woo_options['woo_slider_' . $v];
             }
         }
         // Set auto speed to 0 if we want to disable automatic sliding.
         if ($autoStart == 'false') {
             $autoSpeed = 0;
         }
         $data = array('speed' => $slideSpeed, 'auto' => $autoSpeed, 'effect' => $effect, 'nextprev' => $nextprev, 'pagination' => $pagination, 'hoverpause' => $hoverpause, 'autoheight' => $autoHeight);
         nxt_localize_script('general', 'woo_slider_settings', $data);
     }
 }
開發者ID:nxtclass,項目名稱:NXTClass-themes,代碼行數:55,代碼來源:theme-js.php

示例10: init_scripts

 /**
  * @internal copied from bp-default/functions.php
  */
 public function init_scripts()
 {
     parent::init_scripts();
     // Bump this when changes are made to bust cache
     $version = '20120110';
     // the global BuddyPress JS - Ajax will not work without it
     nxt_enqueue_script('dtheme-ajax-js', BP_PLUGIN_URL . '/bp-themes/bp-default/_inc/global.js', array('jquery'), $version);
     // Add words that we need to use in JS to the end of the page so they can be translated and still used.
     $params = array('my_favs' => __('My Favorites', 'buddypress'), 'accepted' => __('Accepted', 'buddypress'), 'rejected' => __('Rejected', 'buddypress'), 'show_all_comments' => __('Show all comments for this thread', 'buddypress'), 'show_all' => __('Show all', 'buddypress'), 'comments' => __('comments', 'buddypress'), 'close' => __('Close', 'buddypress'), 'view' => __('View', 'buddypress'), 'mark_as_fav' => __('Favorite', 'buddypress'), 'remove_fav' => __('Remove Favorite', 'buddypress'));
     nxt_localize_script('dtheme-ajax-js', 'BP_DTheme', $params);
 }
開發者ID:nxtclass,項目名稱:NXTClass-themes,代碼行數:14,代碼來源:class.php

示例11: __construct

 function __construct()
 {
     $widget_ops = array('description' => __('A dynamic list of recently active, popular, and newest groups', 'buddypress'));
     parent::__construct(false, __('Groups', 'buddypress'), $widget_ops);
     if (is_active_widget(false, false, $this->id_base) && !is_admin() && !is_network_admin()) {
         if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
             nxt_enqueue_script('groups_widget_groups_list-js', BP_PLUGIN_URL . '/bp-groups/js/widget-groups.dev.js', array('jquery'));
         } else {
             nxt_enqueue_script('groups_widget_groups_list-js', BP_PLUGIN_URL . '/bp-groups/js/widget-groups.js', array('jquery'));
         }
     }
 }
開發者ID:nxtclass,項目名稱:NXTClass,代碼行數:12,代碼來源:bp-groups-widgets.php

示例12: init_scripts

 /**
  */
 public function init_scripts()
 {
     parent::init_scripts();
     if (is_admin()) {
         // need uploader plugin, ajax response, image editor scripts
         nxt_enqueue_script('ice-uploader');
         nxt_enqueue_script('nxt-ajax-response');
         nxt_enqueue_script('image-edit');
         // localize the upload wrapper
         $this->localize_script();
     }
 }
開發者ID:nxtclass,項目名稱:NXTClass-themes,代碼行數:14,代碼來源:class.php

示例13: __construct

 function __construct()
 {
     $widget_ops = array('description' => __('A dynamic list of recently active, popular, and newest members', 'buddypress'));
     parent::__construct(false, $name = __('Members', 'buddypress'), $widget_ops);
     if (is_active_widget(false, false, $this->id_base) && !is_admin() && !is_network_admin()) {
         if (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG) {
             nxt_enqueue_script('bp_core_widget_members-js', BP_PLUGIN_URL . '/bp-core/js/widget-members.dev.js', array('jquery'), '20110723');
         } else {
             nxt_enqueue_script('bp_core_widget_members-js', BP_PLUGIN_URL . '/bp-core/js/widget-members.js', array('jquery'), '20110723');
         }
     }
 }
開發者ID:nxtclass,項目名稱:NXTClass-Plugin,代碼行數:12,代碼來源:bp-core-widgets.php

示例14: init_scripts

 /**
  * Enqueue required scripts
  */
 public function init_scripts()
 {
     // call parent
     parent::init_scripts();
     // jQuery UI is always needed
     nxt_enqueue_script('jquery-ui-accordion');
     nxt_enqueue_script('jquery-ui-button');
     nxt_enqueue_script('jquery-ui-dialog');
     nxt_enqueue_script('jquery-ui-progressbar');
     nxt_enqueue_script('jquery-ui-tabs');
     // call localize script *LAST*
     $this->localize_script();
 }
開發者ID:nxtclass,項目名稱:NXTClass-themes,代碼行數:16,代碼來源:registry.php

示例15: woothemes_add_javascript

 function woothemes_add_javascript()
 {
     global $woo_options;
     nxt_register_script('prettyPhoto', get_template_directory_uri() . '/includes/js/jquery.prettyPhoto.js', array('jquery'));
     nxt_register_script('portfolio', get_template_directory_uri() . '/includes/js/portfolio.js', array('jquery', 'prettyPhoto'));
     nxt_register_script('flexslider', get_template_directory_uri() . '/includes/js/jquery.flexslider.min.js', array('jquery'));
     if ((is_home() || is_front_page()) && isset($woo_options['woo_featured']) && $woo_options['woo_featured'] == 'true') {
         nxt_enqueue_script('flexslider');
     }
     if (is_page_template('template-portfolio.php') || is_front_page() || is_singular() && get_post_type() == 'portfolio' || is_tax('portfolio-gallery') || is_post_type_archive('portfolio')) {
         nxt_enqueue_script('portfolio');
     }
     nxt_enqueue_script('third party', get_template_directory_uri() . '/includes/js/third-party.js', array('jquery'));
     nxt_enqueue_script('general', get_template_directory_uri() . '/includes/js/general.js', array('jquery'));
 }
開發者ID:nxtclass,項目名稱:NXTClass-themes,代碼行數:15,代碼來源:theme-js.php


注:本文中的nxt_enqueue_script函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。