本文整理汇总了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’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’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');
}
示例2: init_scripts
/**
*/
public function init_scripts()
{
parent::init_scripts();
if (is_admin()) {
nxt_enqueue_script('jquery-jstree');
}
}
示例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'));
}
示例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);
}
}
示例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');
}
}
示例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');
}
示例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');
}
示例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');
}
示例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);
}
}
示例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);
}
示例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'));
}
}
}
示例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();
}
}
示例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');
}
}
}
示例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();
}
示例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'));
}