本文整理汇总了PHP中wp_dequeue_script函数的典型用法代码示例。如果您正苦于以下问题:PHP wp_dequeue_script函数的具体用法?PHP wp_dequeue_script怎么用?PHP wp_dequeue_script使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wp_dequeue_script函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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');
}
}
示例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);
}
}
}
}
示例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;
}
示例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');
}
}
示例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');
}
}
示例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);
}
}
示例7: disable_autosave
public function disable_autosave()
{
global $post;
//if ( $post && get_post_type( $post->ID ) === 'page-section' ) {
wp_dequeue_script('autosave');
//}
}
示例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);
}
示例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');
}
示例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);
}
}
示例11: disable_autosave
public static function disable_autosave()
{
global $post;
if ($post && get_post_type($post->ID) === 'donation_list') {
wp_dequeue_script('autosave');
}
}
示例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');
}
示例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');
}
}
示例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');
}
示例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;
}