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

PHP wp_dequeue_script函数代码示例

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

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



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

示例1: child_manage_woocommerce_styles

/**
 * Remove WooCommerce Generator tag, styles, and scripts from the homepage.
 * Tested and works with WooCommerce 2.0+
 *
 * @author Greg Rickaby
 * @since 2.0.0
 */
function child_manage_woocommerce_styles()
{
    remove_action('wp_head', array($GLOBALS['woocommerce'], 'generator'));
    if (!is_woocommerce() && !is_cart() && !is_checkout()) {
        wp_dequeue_style('woocommerce_frontend_styles');
        wp_dequeue_style('woocommerce_fancybox_styles');
        wp_dequeue_style('woocommerce_chosen_styles');
        wp_dequeue_style('woocommerce_prettyPhoto_css');
        wp_dequeue_script('wc_price_slider');
        wp_dequeue_script('wc-single-product');
        wp_dequeue_script('wc-add-to-cart');
        wp_dequeue_script('wc-cart-fragments');
        wp_dequeue_script('wc-checkout');
        wp_dequeue_script('wc-add-to-cart-variation');
        wp_dequeue_script('wc-single-product');
        wp_dequeue_script('wc-cart');
        wp_dequeue_script('wc-chosen');
        wp_dequeue_script('woocommerce');
        wp_dequeue_script('prettyPhoto');
        wp_dequeue_script('prettyPhoto-init');
        wp_dequeue_script('jquery-blockui');
        wp_dequeue_script('jquery-placeholder');
        wp_dequeue_script('fancybox');
        wp_dequeue_script('jqueryui');
    }
}
开发者ID:vespertines,项目名称:wordpress_theme_starter,代码行数:33,代码来源:woocommerce.php


示例2: register_scripts_and_styles

 /**
  * Registers and enqueues stylesheets for the administration panel and the
  * public facing site.
  *
  * Example:
  * self::enqueue_shared_file('SCRIPT-ID',  INBOUNDNOW_SHARED_PATH . 'assets/js/frontend/path-in-shared-assets.js', 'localized_var_name', $localized_array_values, $dependancies_array );
  */
 static function register_scripts_and_styles()
 {
     /* Frontent and Backend Files */
     /* Conditionals for admin or frontend */
     if (is_admin()) {
         /*self::enqueue_shared_file('inbound-analytics', 'assets/js/frontend/analytics/inboundAnalytics.js', array( 'jquery' ), 'inbound_settings', self::localize_lead_data()); */
         self::enqueue_shared_file('jquery-cookie', 'assets/js/global/jquery.cookie.js', array('jquery'));
         self::enqueue_shared_file('jquery-total-storage', 'assets/js/global/jquery.total-storage.min.js', array('jquery'));
         $inbound_now_screens = Inbound_Compatibility::return_inbound_now_screens();
         /* list of inbound now screens */
         $screen = get_current_screen();
         /* Target Specific screen with echo $screen->id; */
         if ($screen->id == 'wp-call-to-action') {
             self::enqueue_shared_file('image-picker-js', 'assets/js/admin/image-picker.js');
             self::enqueue_shared_file('image-picker-css', 'assets/css/admin/image-picker.css');
         }
     } else {
         global $wp_scripts;
         $store = false;
         if (!empty($wp_scripts->queue)) {
             $store = $wp_scripts->queue;
             /* store the scripts */
             foreach ($wp_scripts->queue as $handle) {
                 wp_dequeue_script($handle);
             }
         }
         /* unminified source available */
         self::enqueue_shared_file('inbound-analytics', 'assets/js/frontend/analytics/inboundAnalytics.min.js', array('jquery'), 'inbound_settings', self::localize_lead_data());
         if (is_array($store)) {
             foreach ($store as $handle) {
                 wp_enqueue_script($handle);
             }
         }
     }
 }
开发者ID:gbaladi,项目名称:landing-pages,代码行数:42,代码来源:assets.loader.class.php


示例3: dialogs_markup

 function dialogs_markup()
 {
     $out = '';
     $widgets = GoogleMapsWidget::$widgets;
     if (!$widgets) {
         wp_dequeue_script('gmw');
         wp_dequeue_script('gmw-fancybox');
         return;
     }
     foreach ($widgets as $widget) {
         if ($widget['bubble']) {
             $iwloc = 'addr';
         } else {
             $iwloc = 'near';
         }
         if ($widget['ll']) {
             $ll = '&ll=' . $widget['ll'];
         } else {
             $ll = '';
         }
         $map_url = 'http://maps.google.com/maps?hl=en&ie=utf8&output=embed&iwloc=' . $iwloc . '&iwd=1&mrt=loc&t=' . $widget['type'] . '&q=' . urlencode(remove_accents($widget['address'])) . '&z=' . urlencode($widget['zoom']) . $ll;
         $out .= '<div class="gmw-dialog" style="display: none;" data-map-height="' . $widget['height'] . '" data-map-width="' . $widget['width'] . '" data-map-skin="' . $widget['skin'] . '" data-map-iframe-url="' . $map_url . '" id="dialog-' . $widget['id'] . '" title="' . esc_attr($widget['title']) . '">';
         if ($widget['header']) {
             $out .= '<div class="gmw-header"><i>' . do_shortcode($widget['header']) . '</i></div>';
         }
         $out .= '<div class="gmw-map"></div>';
         if ($widget['footer']) {
             $out .= '<div class="gmw-footer"><i>' . do_shortcode($widget['footer']) . '</i></div>';
         }
         $out .= "</div>\n";
     }
     // foreach $widgets
     echo $out;
 }
开发者ID:Alpha7Sg,项目名称:wordpress-custom,代码行数:34,代码来源:google-maps-widget.php


示例4: sf_remove_woo_lightbox_js

function sf_remove_woo_lightbox_js()
{
    if (!class_exists('WC_Quick_View')) {
        wp_dequeue_script('prettyPhoto');
        wp_dequeue_script('prettyPhoto-init');
    }
}
开发者ID:jamesvillarrubia,项目名称:uniken-web,代码行数:7,代码来源:sf-woocommerce.php


示例5: woocommerce_disable_autosave_for_orders

/**
 * Disable the auto-save functionality for Orders.
 *
 * @access public
 * @return void
 */
function woocommerce_disable_autosave_for_orders()
{
    global $post;
    if ($post && get_post_type($post->ID) === 'shop_order') {
        wp_dequeue_script('autosave');
    }
}
开发者ID:joshquila,项目名称:demo2-youse,代码行数:13,代码来源:shop_order.php


示例6: check_for_multiple_google_maps_api_calls

 /**
  * Load Google Maps API
  *
  * Determine if Google Maps API script has already been loaded
  * @since      : 1.0.3
  * @return bool $multiple_google_maps_api
  */
 public function check_for_multiple_google_maps_api_calls()
 {
     global $wp_scripts;
     if (!$wp_scripts) {
         return false;
     }
     //loop through registered scripts
     foreach ($wp_scripts->registered as $registered_script) {
         //find any that have the google script as the source, ensure it's not enqueud by this plugin
         if (strpos($registered_script->src, 'maps.googleapis.com/maps/api/js') !== false && strpos($registered_script->handle, 'google-maps-builder') === false || strpos($registered_script->src, 'maps.google.com/maps/api/js') !== false && strpos($registered_script->handle, 'google-maps-builder') === false) {
             //Remove this script from loading
             wp_deregister_script($registered_script->handle);
             wp_dequeue_script($registered_script->handle);
             $this->google_maps_conflict = true;
             //ensure we can detect scripts on the frontend from backend; we'll use an option to do this
             if (!is_admin()) {
                 update_option('gmb_google_maps_conflict', true);
             }
         }
     }
     //Ensure that if user resolved conflict on frontend we remove the option flag
     if ($this->google_maps_conflict === false && !is_admin()) {
         update_option('gmb_google_maps_conflict', false);
     }
 }
开发者ID:WordImpress,项目名称:maps-builder-core,代码行数:32,代码来源:class-gmc-scripts.php


示例7: disable_autosave

 public function disable_autosave()
 {
     global $post;
     //if ( $post && get_post_type( $post->ID ) === 'page-section' ) {
     wp_dequeue_script('autosave');
     //}
 }
开发者ID:jonasbelcina,项目名称:platinumdxb,代码行数:7,代码来源:admin.php


示例8: presscore_total_cache_remove_scripts

/**
 * Remove platfoem dependent scripts.
 *
 */
function presscore_total_cache_remove_scripts()
{
    wp_dequeue_script('dt-tablet', get_template_directory_uri() . '/js/desktop-tablet.js', array('jquery'), false, true);
    wp_dequeue_script('dt-phone', get_template_directory_uri() . '/js/phone.js', array('jquery'), false, true);
    wp_dequeue_script('dt-desktop', get_template_directory_uri() . '/js/desktop.js', array('jquery'), false, true);
    wp_dequeue_script('dt-main', get_template_directory_uri() . '/js/main.js', array('jquery'), false, true);
}
开发者ID:noman90rauf,项目名称:wp-content,代码行数:11,代码来源:mod-totalcache.php


示例9: _tcg_load_theme_files

/**
* Load theme scripts in the footer
*
* Big thanks to Chris Ferdinandi on this one!
* ref: http://gomakethings.com/inlining-critical-css-for-better-web-performance/
*/
function _tcg_load_theme_files()
{
    // If stylesheet is in browser cache, load it the traditional way
    // Otherwise, inline critical CSS and load full stylesheet asynchronously
    // See _tcg_initialize_theme_detects()
    // Load theme fonts
    wp_enqueue_style('_tcg-fonts', '//fonts.googleapis.com/css?family=Poiret+One');
    // Load comment script from origina _s
    if (is_singular() && comments_open() && get_option('thread_comments')) {
        wp_enqueue_script('comment-reply');
    }
    // Re-enable & test this if browser paint delays
    if (isset($_COOKIE['fullCSS']) && $_COOKIE['fullCSS'] === 'true') {
        wp_enqueue_style('_tcg-theme-styles', get_template_directory_uri() . '/style.css', null, null, 'all');
    }
    // Move jquery to the footer
    // it's being defer'd instead of async'd - move to header and load renderblocking in case of bugginess
    // get rid of jquery-migrate cause we're too cocky and smart for that shit.
    wp_deregister_script('jquery');
    wp_dequeue_script('jquery');
    wp_register_script('jquery-core', includes_url('/js/jquery/jquery.js'), false, NULL, true);
    wp_enqueue_script('jquery-core');
    // Add dependency to jquery-core for Asset Queue Manager, DO NOT load in footer or aqm fails
    wp_register_script('asset-queue-manager', '/wp-content/plugins/asset-queue-manager/assets/js/aqm.min.js', 'jquery-core', NULL, false);
    // Apparently enqueueing isn't necessary, may want to research this more
    // wp_enqueue_script( 'asset-queue-manager' );
    wp_register_script('_tcg-theme-scripts', get_template_directory_uri() . '/js/main.min.js', 'jquery-core', null, true);
    wp_enqueue_script('_tcg-theme-scripts');
}
开发者ID:dylanjharris,项目名称:tcg,代码行数:35,代码来源:enqueue.php


示例10: javo_dequeue_scripts

function javo_dequeue_scripts()
{
    $javo_dequeue_scripts = array('bootstrap', 'jQuery-Easing', 'jQuery-Ajax-form', 'sns-link', 'jQuery-Rating', 'jQuery-Spectrum', 'jQuery-parallax', 'jQuery-javo-Emailer', 'javo-assets-common-script', 'bootstrap-hover-dropdown', 'bootstrap-select-script', 'javo-Footer-script', 'bootstrap-markdown', 'bootstrap-markdown-fr', 'jQuery-QuickSnad', 'jQuery-nouiSlider', 'okVideo-Plugin', 'slight-submenu.min-Plugin', 'gmap3', 'oms-same-position-script', 'Javo-common-script', 'jQuery-chosen-autocomplete', 'javoThemes-Message-Plugin', 'jQuery-Parallax', 'jQuery-javo-Favorites', 'jQuery-javo-search', 'jQuery-flex-Slider', 'Google-Map-Info-Bubble', 'Pace-Script', 'single-reviews-modernizr.custom', 'jquery.magnific-popup');
    foreach ($javo_dequeue_scripts as $javo_dequeue_script) {
        wp_dequeue_script($javo_dequeue_script);
    }
}
开发者ID:redcypress,项目名称:lacecake,代码行数:7,代码来源:functions.php


示例11: disable_autosave

 public static function disable_autosave()
 {
     global $post;
     if ($post && get_post_type($post->ID) === 'donation_list') {
         wp_dequeue_script('autosave');
     }
 }
开发者ID:partisan-collective,项目名称:partisan,代码行数:7,代码来源:class-donation-button-list.php


示例12: be_woo_remove_default_lightbox_js

 function be_woo_remove_default_lightbox_js()
 {
     remove_action('wp_head', array($GLOBALS['woocommerce'], 'generator'));
     wp_dequeue_style('woocommerce_prettyPhoto_css');
     wp_dequeue_script('prettyPhoto');
     wp_dequeue_script('prettyPhoto-init');
 }
开发者ID:leloulight,项目名称:monero,代码行数:7,代码来源:be-woo-functions.php


示例13: disable_autosave

 /**
  * Disable the auto-save functionality for Orders.
  */
 public function disable_autosave()
 {
     global $post;
     if ($post && in_array(get_post_type($post->ID), array('lp_order'))) {
         wp_dequeue_script('autosave');
     }
 }
开发者ID:thonysmith,项目名称:LearnPress,代码行数:10,代码来源:order.php


示例14: script_check

function script_check()
{
    wp_dequeue_script('jquery');
    wp_deregister_script('jquery');
    wp_register_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js', null, null);
    wp_enqueue_script('jquery');
}
开发者ID:dangodev,项目名称:mamas-sauce-concept,代码行数:7,代码来源:functions.php


示例15: throw404

 /**
  * Launch and display the 404 page depending upon the template
  *
  * @param   void
  * @return  void
  **/
 public function throw404()
 {
     // Change WP Query
     global $wp_query;
     $wp_query->set_404();
     status_header(404);
     // Disable that pesky Admin Bar
     add_filter('show_admin_bar', '__return_false', 900);
     remove_action('admin_footer', 'wp_admin_bar_render', 10);
     remove_action('wp_head', 'wp_admin_bar_header', 10);
     remove_action('wp_head', '_admin_bar_bump_cb', 10);
     wp_dequeue_script('admin-bar');
     wp_dequeue_style('admin-bar');
     // Template
     $four_tpl = apply_filters('LD_404', get_404_template());
     // Handle the admin bar
     @define('APP_REQUEST', TRUE);
     @define('DOING_AJAX', TRUE);
     if (empty($four_tpl) or !file_exists($four_tpl)) {
         // We're gonna try and get TwentyTen's one
         $twenty_ten_tpl = apply_filters('LD_404_FALLBACK', WP_CONTENT_DIR . '/themes/twentyfourteen/404.php');
         if (file_exists($twenty_ten_tpl)) {
             require $twenty_ten_tpl;
         } else {
             wp_die('404 - File not found!', '', array('response' => 404));
         }
     } else {
         // Their theme has a template!
         require $four_tpl;
     }
     // Either way, it's gonna stop right here.
     exit;
 }
开发者ID:estrategasdigitales,项目名称:glummer,代码行数:39,代码来源:Application.php


示例16: yoimg_crop_load_styles_and_scripts

function yoimg_crop_load_styles_and_scripts($hook)
{
    if (YOIMG_CROP_ENABLED) {
        if ($hook == 'post.php') {
            wp_enqueue_media();
        } else {
            if ($hook == 'upload.php') {
                // issue http://stackoverflow.com/questions/25884434/wordpress-wp-enqueue-media-causes-javascript-error-from-wp-admin-upload-phpmo
                $mode = get_user_option('media_library_mode', get_current_user_id()) ? get_user_option('media_library_mode', get_current_user_id()) : 'grid';
                $modes = array('grid', 'list');
                if (isset($_GET['mode']) && in_array($_GET['mode'], $modes)) {
                    $mode = $_GET['mode'];
                    update_user_option(get_current_user_id(), 'media_library_mode', $mode);
                }
                if ('list' === $mode) {
                    $version = get_bloginfo('version');
                    // issue https://wordpress.org/support/topic/findposts-is-not-defined
                    if (version_compare($version, '4.2.2') < 0) {
                        wp_dequeue_script('media');
                    }
                    wp_enqueue_media();
                }
            } else {
                wp_enqueue_style('media-views');
            }
        }
        wp_enqueue_style('wp-pointer');
        wp_enqueue_style('yoimg-cropping-css', YOIMG_CROP_URL . '/css/yoimg-cropping.css');
        wp_enqueue_style('yoimg-cropper-css', YOIMG_CROP_URL . '/js/cropper/cropper.min.css');
        wp_enqueue_script('wp-pointer');
        wp_enqueue_script('yoimg-cropper-js', YOIMG_CROP_URL . '/js/cropper/cropper.min.js', array('jquery'), false, true);
        wp_enqueue_script('yoimg-cropping-js', YOIMG_CROP_URL . '/js/yoimg-cropping.js', array('yoimg-cropper-js'), false, true);
    }
}
开发者ID:jawngee,项目名称:yoimages-crop,代码行数:34,代码来源:init.php


示例17: scripts

 /**
  * 
  *  Add scripts
  */
 function scripts()
 {
     // Remove Script
     wp_dequeue_script('prettyPhoto');
     wp_dequeue_script('prettyPhoto-init');
     wp_dequeue_script('woocommerce_prettyPhoto_css');
 }
开发者ID:sniezekjp,项目名称:prod-fs,代码行数:11,代码来源:woo.php


示例18: wc_tab_manager_disable_autosave_for_product_tabs

/**
 * Disable the auto-save functionality for Tabs.
 *
 * @access public
 */
function wc_tab_manager_disable_autosave_for_product_tabs()
{
    global $post;
    if ($post && 'wc_product_tab' === get_post_type($post->ID)) {
        wp_dequeue_script('autosave');
    }
}
开发者ID:Atlas-Solutions-Group,项目名称:mn-woocommerce-tab-manager,代码行数:12,代码来源:wc_product_tab.php


示例19: disable_autosave

 /**
  * Disable the auto-save functionality for Orders.
  *
  * @access public
  * @return void
  */
 public function disable_autosave()
 {
     global $post;
     if ($post && get_post_type($post->ID) === 'shop_order') {
         wp_dequeue_script('autosave');
     }
 }
开发者ID:Joaquinsemp,项目名称:patriestausado,代码行数:13,代码来源:class-wc-admin-post-types.php


示例20: load_scripts

 public static function load_scripts()
 {
     wp_dequeue_script('fitvids');
     wp_dequeue_script('flexslider');
     wp_deregister_script('fitvids');
     wp_deregister_script('flexslider');
     // Register our common scripts
     wp_register_script('froogaloop', VIMEOGRAPHY_ASSETS_URL . 'js/plugins/froogaloop2.min.js');
     wp_register_script('flexslider', VIMEOGRAPHY_ASSETS_URL . 'js/plugins/jquery.flexslider.js', array('jquery'));
     wp_register_script('fitvids', VIMEOGRAPHY_ASSETS_URL . 'js/plugins/jquery.fitvids.js', array('jquery'));
     wp_register_script('spin', VIMEOGRAPHY_ASSETS_URL . 'js/plugins/spin.min.js', array('jquery'));
     wp_register_script('jquery-spin', VIMEOGRAPHY_ASSETS_URL . 'js/plugins/jquery.spin.js', array('jquery', 'spin'));
     wp_register_script('vimeography-utilities', VIMEOGRAPHY_ASSETS_URL . 'js/utilities.js', array('jquery'));
     wp_register_script('vimeography-pagination', VIMEOGRAPHY_ASSETS_URL . 'js/pagination.js', array('jquery'));
     // Register our custom scripts
     wp_register_style('bugsauce', plugins_url('assets/css/bugsauce.css', __FILE__));
     wp_enqueue_script('froogaloop');
     wp_enqueue_script('flexslider');
     wp_enqueue_script('fitvids');
     wp_enqueue_script('spin');
     wp_enqueue_script('jquery-spin');
     wp_enqueue_script('vimeography-utilities');
     wp_enqueue_script('vimeography-pagination');
     wp_enqueue_style('bugsauce');
 }
开发者ID:juansalvatella,项目名称:dosnoventa,代码行数:25,代码来源:vimeography-bugsauce.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP wp_dequeue_style函数代码示例发布时间:2022-05-23
下一篇:
PHP wp_delete_user函数代码示例发布时间: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