• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP wp_enqueue_script函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: localedge_scripts_and_styles

function localedge_scripts_and_styles()
{
    global $wp_styles;
    // call global $wp_styles variable to add conditional wrapper around ie stylesheet the WordPress way
    // modernizr (without media query polyfill)
    wp_enqueue_script('localedge-modernizr', '//cdnjs.cloudflare.com/ajax/libs/modernizr/2.7.1/modernizr.min.js', false, null);
    // respondjs
    wp_enqueue_script('localedge-respondjs', '//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js', false, null);
    // register main stylesheet
    wp_enqueue_style('localedge-stylesheet', get_stylesheet_directory_uri() . '/css/style.css', array(), '', 'all');
    // ie-only style sheet
    wp_enqueue_style('localedge-ie-only', get_stylesheet_directory_uri() . '/css/ie.css', array(), '');
    $wp_styles->add_data('localedge-ie-only', 'conditional', 'lt IE 9');
    // add conditional wrapper around ie stylesheet
    //Magnific Popup (LightBox)
    wp_enqueue_script('localedge-magnific-popup-js', '//cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/0.9.9/jquery.magnific-popup.min.js', array('jquery'), '0.9.9', true);
    //Font Awesome (icon set)
    wp_enqueue_style('localedge-font-awesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.0.3/css/font-awesome.min.css', array(), '4.0.3');
    // iCheck (better radio and checkbox inputs)
    wp_enqueue_script('localedge-icheck', '//cdnjs.cloudflare.com/ajax/libs/iCheck/1.0.1/icheck.min.js', array('jquery'), '1.0.1', true);
    //Chosen - http://harvesthq.github.io/chosen/
    wp_enqueue_script('chosen-js', '//cdnjs.cloudflare.com/ajax/libs/chosen/1.1.0/chosen.jquery.min.js', array('jquery'), '1.1.0', true);
    // comment reply script for threaded comments
    if (is_singular() and comments_open() and get_option('thread_comments') == 1) {
        wp_enqueue_script('comment-reply');
    }
    //adding scripts file in the footer
    wp_enqueue_script('localedge-js', get_stylesheet_directory_uri() . '/js/scripts.js', array('jquery'), '', true);
}
开发者ID:maverickmediaco,项目名称:truenorthrealtorsny,代码行数:29,代码来源:functions.php


示例2: sectioned_page_output

 function sectioned_page_output()
 {
     wp_enqueue_script('sticky', WP_PLUGIN_URL . '/' . plugin_dir_path('msd-specialty-pages/msd-specialty-pages.php') . '/lib/js/jquery.sticky.js', array('jquery'), FALSE, TRUE);
     global $post, $subtitle_metabox, $sectioned_page_metabox, $nav_ids;
     $i = 0;
     $meta = $sectioned_page_metabox->the_meta();
     if (is_object($sectioned_page_metabox)) {
         while ($sectioned_page_metabox->have_fields('sections')) {
             $layout = $sectioned_page_metabox->get_the_value('layout');
             switch ($layout) {
                 case "three-boxes":
                     break;
                 default:
                     $sections[] = self::default_output($meta['sections'][$i], $i);
                     break;
             }
             $i++;
         }
         //close while
         print '<div class="sectioned-page-wrapper">';
         print implode("\n", $sections);
         print '</div>';
     }
     //clsoe if
 }
开发者ID:foxydot,项目名称:daretocare,代码行数:25,代码来源:sectioned.php


示例3: admin_google_font_scripts

 function admin_google_font_scripts()
 {
     wp_register_script('ultimate-google-fonts-script', plugins_url("../admin/js/google-fonts-admin.js", __FILE__), array('jquery'));
     wp_enqueue_script('ultimate-google-fonts-script');
     wp_register_style('ultimate-google-fonts-style', plugins_url("../admin/css/google-fonts-admin.css", __FILE__));
     wp_enqueue_style('ultimate-google-fonts-style');
 }
开发者ID:cimocimocimo,项目名称:staydrysystems.com,代码行数:7,代码来源:Ultimate_Font_Manager.php


示例4: _enqueue_static

 /**
  * @internal
  * {@inheritdoc}
  */
 protected function _enqueue_static($id, $option, $data)
 {
     wp_enqueue_style('fw-option-' . $this->get_type(), fw_get_framework_directory_uri('/includes/option-types/' . $this->get_type() . '/static/css/styles.css'), array(), fw()->manifest->get_version());
     wp_enqueue_script('fw-option-' . $this->get_type(), fw_get_framework_directory_uri('/includes/option-types/' . $this->get_type() . '/static/js/scripts.js'), array('fw-events', 'jquery-ui-sortable'), fw()->manifest->get_version(), true);
     fw()->backend->enqueue_options_static($option['box-options']);
     return true;
 }
开发者ID:floq-design,项目名称:Unyson,代码行数:11,代码来源:class-fw-option-type-addable-box.php


示例5: ox_adding_scripts

function ox_adding_scripts()
{
    if (!function_exists('is_login_page')) {
        function is_login_page()
        {
            return !strncmp($_SERVER['REQUEST_URI'], '/wp-login.php', strlen('/wp-login.php'));
        }
    }
    if (!is_admin() && !is_login_page()) {
        /*removed wp-embed.min.js*/
        wp_deregister_script('wp-embed');
        /*jquery*/
        wp_deregister_script('jquery');
        $infooter = !is_page(array($order_form_pages)) ? true : false;
        wp_register_script('jquery', "http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js", false, '1.11.3', $infooter);
        wp_enqueue_script('jquery');
        /*bootstrap*/
        wp_enqueue_style('bootstrap', get_template_directory_uri() . '/css/bootstrap.min.css');
        /*slicknav menu*/
        wp_enqueue_script('slicknav', get_template_directory_uri() . '/js/jquery.slicknav.min.js', array('jquery'), '', true);
        /*bxslider*/
        wp_enqueue_style('bxslider', get_template_directory_uri() . '/css/jquery.bxslider.min.css');
        wp_enqueue_script('bxslider', get_template_directory_uri() . '/js/jquery.bxslider.min.js', array('jquery'), '', true);
        /*zopim chat*/
        wp_enqueue_script('zopim', get_template_directory_uri() . '/js/zopimClear.js', array('jquery'), '', true);
        /*custom css*/
        wp_enqueue_style('custom', get_template_directory_uri() . '/style.css', array('bootstrap'));
        /*custom js*/
        wp_enqueue_script('custom', get_template_directory_uri() . '/js/custom.js', array('jquery'), '', true);
    }
}
开发者ID:OlgaX,项目名称:wp-template,代码行数:31,代码来源:functions.php


示例6: twentyhua_10_scripts_styles

function twentyhua_10_scripts_styles()
{
    // bootstrap
    wp_enqueue_script('twentyhua-script', get_template_directory_uri() . '/js/bootstrap.min.js', array('jquery'), '20150701', true);
    wp_enqueue_style('twentyhua-style', get_template_directory_uri() . '/css/bootstrap.min.css', array(), '20150701');
    wp_enqueue_style('twentyhua-style', get_template_directory_uri() . '/css/bootstrap-theme.min.css', array(), '20150701');
}
开发者ID:DonghuaLau,项目名称:myblog,代码行数:7,代码来源:10_functions.php


示例7: sfsi_footerFeedbackScript

function sfsi_footerFeedbackScript()
{
    wp_enqueue_style('wp-pointer');
    wp_enqueue_script('wp-pointer');
    wp_enqueue_script('utils');
    // for user settings
    $html = '<div>';
    $html .= '<label>Optional: Please tell us why you deactivate our plugin so that we can make it better!</label>';
    $html .= '<textarea id="sfsi_feedbackMsg" name="reason"></textarea>';
    $html .= '</div>';
    ?>
    <script type="text/javascript">
		jQuery('#social-media-and-share-icons-ultimate-social-media .deactivate a').click(function(){
			jQuery('#social-media-and-share-icons-ultimate-social-media .deactivate a').pointer({
				content: '<form method="post" id="sfsi_feedbackForm"><?php 
    echo $html;
    ?>
<div><input type="button" name="sfsi_sendFeedback" value="Submit & Deactivate" class="button primary-button" /></div><img id="sfsi_loadergif" src="<?php 
    echo site_url() . "/wp-includes/images/spinner.gif";
    ?>
" /></form>',
				position: {
					edge:'top',
					align:'left',
				},
				close: function() {
					//
				}
			}).pointer('open');
			return false;
		});
		jQuery("body").on("click","input[name='sfsi_sendFeedback']", function(){
			var ajaxurl = '<?php 
    echo admin_url('admin-ajax.php');
    ?>
';
			var deactivateUrl = jQuery('#social-media-and-share-icons-ultimate-social-media .deactivate a').attr('href');
			var e = {
				action:"sfsi_feedbackForm",
				email: '<?php 
    echo get_option("admin_email");
    ?>
',
				msg:jQuery("#sfsi_feedbackMsg").val()
			};
			jQuery("#sfsi_loadergif").show();
			jQuery.ajax({
				url:ajaxurl,
				type:"post",
				data:e,
				success:function(responce) {
					//alert(responce);
					jQuery("#sfsi_loadergif").hide();
					window.location.href = deactivateUrl;
				}
			});
		});
	</script>
	<?php 
}
开发者ID:andrewfieldwmg,项目名称:greenschoolsproject,代码行数:60,代码来源:sfsi_Init_JqueryCss.php


示例8: InitClass

 static function InitClass()
 {
     wp_enqueue_style(WPFB . '-admin', WPFB_PLUGIN_URI . 'css/admin.css', array(), WPFB_VERSION, 'all');
     wp_register_script('jquery-deserialize', WPFB_PLUGIN_URI . 'bower_components/jquery-deserialize/dist/jquery.deserialize.min.js', array('jquery'), WPFB_VERSION);
     if (isset($_GET['page'])) {
         $page = $_GET['page'];
         if ($page == 'wpfilebase_files') {
             wp_enqueue_script('postbox');
             wp_enqueue_style('dashboard');
         } elseif ($page == 'wpfilebase' && isset($_GET['action']) && $_GET['action'] == 'sync') {
             do_action('wpfilebase_sync');
             wp_die("Filebase synced.");
         }
     }
     add_action('wp_dashboard_setup', array(__CLASS__, 'AdminDashboardSetup'));
     //wp_register_widget_control(WPFB_PLUGIN_NAME, "[DEPRECATED]".WPFB_PLUGIN_NAME .' '. __('File list','wp-filebase'), array(__CLASS__, 'WidgetFileListControl'), array('description' => __('DEPRECATED','wp-filebase')));
     add_action('admin_print_scripts', array('WPFB_AdminLite', 'AdminPrintScripts'));
     self::CheckChangedVer();
     if (basename($_SERVER['PHP_SELF']) === "plugins.php") {
         if (isset($_GET['wpfb-uninstall']) && current_user_can('edit_files')) {
             update_option('wpfb_uninstall', !empty($_GET['wpfb-uninstall']) && $_GET['wpfb-uninstall'] != "0");
         }
         if (get_option('wpfb_uninstall')) {
             function wpfb_uninstall_warning()
             {
                 echo "\n\t\t\t\t<div id='wpfb-warning' class='updated fade'><p><strong>" . __('WP-Filebase will be uninstalled completely when deactivating the Plugin! All settings and File/Category Info will be deleted. Actual files in the upload directory will not be removed.', 'wp-filebase') . ' <a href="' . add_query_arg('wpfb-uninstall', '0') . '">' . __('Cancel') . "</a></strong></p></div>\n\t\t\t\t";
             }
             add_action('admin_notices', 'wpfb_uninstall_warning');
         }
     }
 }
开发者ID:noxian,项目名称:WP-Filebase,代码行数:31,代码来源:AdminLite.php


示例9: spacious_scripts_styles_method

/**
 * Register jquery scripts
 */
function spacious_scripts_styles_method()
{
    /**
     * Loads our main stylesheet.
     */
    wp_enqueue_style('spacious_style', get_stylesheet_uri());
    if (of_get_option('spacious_color_skin', 'light') == 'dark') {
        wp_enqueue_style('spacious_dark_style', SPACIOUS_CSS_URL . '/dark.css');
    }
    /**
     * Adds JavaScript to pages with the comment form to support
     * sites with threaded comments (when in use).
     */
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    /**
     * Register JQuery cycle js file for slider.
     */
    wp_register_script('jquery_cycle', SPACIOUS_JS_URL . '/jquery.cycle.all.min.js', array('jquery'), '2.9999.5', true);
    //   wp_register_style( 'google_fonts', 'http://fonts.googleapis.com/css?family=Lato' );
    /**
     * Enqueue Slider setup js file.	 
     */
    if (is_home() || is_front_page() && of_get_option('spacious_activate_slider', '0') == '1') {
        wp_enqueue_script('spacious_slider', SPACIOUS_JS_URL . '/spacious-slider-setting.js', array('jquery_cycle'), false, true);
    }
    wp_enqueue_script('spacious-navigation', SPACIOUS_JS_URL . '/navigation.js', array('jquery'), false, true);
    wp_enqueue_script('spacious-custom', SPACIOUS_JS_URL . '/spacious-custom.js', array('jquery'));
    wp_enqueue_style('google_fonts');
    $spacious_user_agent = strtolower($_SERVER['HTTP_USER_AGENT']);
    if (preg_match('/(?i)msie [1-8]/', $spacious_user_agent)) {
        wp_enqueue_script('html5', SPACIOUS_JS_URL . '/html5.js', true);
    }
}
开发者ID:achrafse,项目名称:CitizenWatt-WordPress-theme,代码行数:38,代码来源:functions.php


示例10: genesis_responsive_slider_settings_scripts

/**
 * Loads the scripts required for the settings page
 */
function genesis_responsive_slider_settings_scripts()
{
    wp_enqueue_script('common');
    wp_enqueue_script('wp-lists');
    wp_enqueue_script('postbox');
    wp_enqueue_script('genesis_responsive_slider_admin_scripts', plugins_url('js/admin.js', __FILE__), array('jquery'), GENESIS_RESPONSIVE_SLIDER_VERSION, TRUE);
}
开发者ID:HandsomeDogStudio,项目名称:peanutbutterplan,代码行数:10,代码来源:admin.php


示例11: enqueue_global_scripts

 /**
  * Enqueue required global styles and scirpts
  *
  * @access public
  * @since  0.0.0
  *
  * @see  wp_enqueue_style()
  *
  * @return void
  */
 public function enqueue_global_scripts()
 {
     //enqueue styles
     wp_enqueue_style('wfg-styles', plugins_url('/css/wfg-styles.css', dirname(__FILE__)));
     //enqueue scripts
     wp_enqueue_script('wfg-scripts', plugins_url('/js/wfg-scripts.js', dirname(__FILE__)), array('jquery'));
 }
开发者ID:ankitpokhrel,项目名称:woocommerce-multiple-free-gift,代码行数:17,代码来源:Woocommerce_Multiple_Free_Gift.class.php


示例12: rsttst_load_styles

function rsttst_load_styles()
{
    if (!is_admin()) {
        wp_enqueue_style('rest-styles', plugins_url('assets/rest-styles.css', __FILE__));
        wp_enqueue_script('rest-scripts', plugins_url('assets/rest-scripts.js', __FILE__), array('jquery'), 1.0);
    }
}
开发者ID:mantismamita,项目名称:rest-api-test,代码行数:7,代码来源:rest-api-test.php


示例13: _cfs_admin_script

function _cfs_admin_script()
{
    wp_register_style('cfs-style', plugins_url('css/cfs_admin.css', dirname(__FILE__)));
    wp_enqueue_style('cfs-style');
    wp_register_script('cfs-script', plugins_url('js/cfs_admin.js', dirname(__FILE__)), array(), '1.0.0', true);
    wp_enqueue_script('cfs-script');
}
开发者ID:bobstermyang,项目名称:communityfoodshare,代码行数:7,代码来源:functions.php


示例14: render_content

    /**
     * Display the font control.
     *
     * @since 1.0.0
     */
    function render_content()
    {
        $v = $this->value();
        $values = json_decode($v);
        wp_enqueue_script('json2');
        $font_options = isset($this->font_options) ? $this->font_options : array();
        ?>

		<?php 
        if ($this->show_label && !empty($this->label)) {
            ?>
			<span class="customize-control-title themify-control-title"><?php 
            echo esc_html($this->label);
            ?>
</span>
		<?php 
        }
        ?>

		<?php 
        $this->render_fonts($values, $font_options);
        ?>

		<input <?php 
        $this->link();
        ?>
 value='<?php 
        echo esc_attr($v);
        ?>
' type="hidden" class="<?php 
        echo esc_attr($this->type);
        ?>
_control themify-customizer-value-field"/>
	<?php 
    }
开发者ID:tchataigner,项目名称:palette,代码行数:40,代码来源:class-fonts-control.php


示例15: wpcf_pr_admin_post_init_action

/**
 * Init function.
 *
 * Enqueues styles and scripts on post edit page.
 *
 * @param type $post_type
 * @param type $post
 * @param type $groups
 * @param type $wpcf_active
 */
function wpcf_pr_admin_post_init_action($post_type, $post, $groups, $wpcf_active)
{
    // See if any data
    $has = wpcf_pr_admin_get_has($post_type);
    $belongs = wpcf_pr_admin_get_belongs($post_type);
    /*
     * Enqueue styles and scripts
     */
    if (!empty($has) || !empty($belongs)) {
        $output = wpcf_pr_admin_post_meta_box_output($post, array('post_type' => $post_type, 'has' => $has, 'belongs' => $belongs));
        add_meta_box('wpcf-post-relationship', __('Post Relationship', 'wpcf'), 'wpcf_pr_admin_post_meta_box', $post_type, 'normal', 'default', array('output' => $output));
        if (!empty($output)) {
            wp_enqueue_script('wpcf-post-relationship', WPCF_EMBEDDED_RELPATH . '/resources/js/post-relationship.js', array('jquery', 'select2'), WPCF_VERSION);
            wp_enqueue_style('wpcf-post-relationship', WPCF_EMBEDDED_RELPATH . '/resources/css/post-relationship.css', array(), WPCF_VERSION);
            if (!$wpcf_active) {
                wpcf_enqueue_scripts();
                wp_enqueue_style('wpcf-pr-post', WPCF_EMBEDDED_RES_RELPATH . '/css/fields-post.css', array(), WPCF_VERSION);
                wp_enqueue_script('wpcf-form-validation', WPCF_EMBEDDED_RES_RELPATH . '/js/' . 'jquery-form-validation/jquery.validate.min.js', array('jquery'), WPCF_VERSION);
                wp_enqueue_script('wpcf-form-validation-additional', WPCF_EMBEDDED_RES_RELPATH . '/js/' . 'jquery-form-validation/additional-methods.min.js', array('jquery'), WPCF_VERSION);
            }
            wpcf_admin_add_js_settings('wpcf_pr_del_warning', '\'' . __('Are you sure about deleting this post?', 'wpcf') . '\'');
            wpcf_admin_add_js_settings('wpcf_pr_pagination_warning', '\'' . __('If you continue without saving your changes, they might get lost.', 'wpcf') . '\'');
        }
    }
}
开发者ID:VanessaGarcia-Freelance,项目名称:CrowdsLine,代码行数:35,代码来源:post-relationship.php


示例16: 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


示例17: core_mods

		function core_mods() {
			if ( !is_admin() ) {
				wp_deregister_script('jquery');
				wp_register_script('jquery', ("//ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"), false);
				wp_enqueue_script('jquery');
			}
		}
开发者ID:neufuture,项目名称:HTML5-Reset-Wordpress-Theme,代码行数:7,代码来源:functions.php


示例18: fast_scripts

/**
 * Enqueue scripts and styles for the theme.
 */
function fast_scripts()
{
    //LOAD style.css via filesystem. Uses Sass to ompile '/assets/scss/style.scss' to: 'styl.css'
    wp_enqueue_style('fast-sass', get_stylesheet_uri(), array(), '1.0.0');
    //LOAD jQuery.min.js via CDN JS
    wp_enqueue_script('fast-jquery', 'https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.4/jquery.min.js', array(), '1.0.0', true);
    //LOAD Boostrap.min.js via CDN JS
    wp_enqueue_script('fast-bootstrap', 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js', array(), '1.0.0', true);
    //LOAD navigation.js via filesystem
    wp_enqueue_script('fast-navigation', get_template_directory_uri() . '/assets/js/navigation.js', array(), '1.0.0', true);
    //LOAD fast-skip-link-focus.js via filesystem
    //wp_enqueue_script( 'fast-skip-link-focus-fix', get_template_directory_uri() . '/assets/js/skip-link-focus-fix.js', array(), '1.0.0', true );
    //LOAD instantclick.js via CDN JS
    wp_enqueue_script('fast-instantclick', 'https://cdnjs.cloudflare.com/ajax/libs/instantclick/3.0.1/instantclick.min.js', array(), '1.0.0', true);
    //CALL instant click into end of footer scripts, for init
    function call_instant_click()
    {
        echo '<script data-no-instant>InstantClick.init();</script>';
    }
    add_action('wp_footer', 'call_instant_click', 200);
    //load at end
    //IF IS singlular & comments are enabled, load comment-reply.js via filesystem
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
}
开发者ID:brianotoole,项目名称:landing-page-skewed-containers,代码行数:29,代码来源:functions.php


示例19: addScripts

 function addScripts()
 {
     if (WP_DEBUG) {
         wp_register_script('livereload', 'http://localhost:35730/livereload.js?snipver=1', null, false, true);
         wp_enqueue_script('livereload');
     }
 }
开发者ID:sararfcarvalho,项目名称:portfolio,代码行数:7,代码来源:functions.php


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wp_enqueue_style函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_enqueue_media函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap