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


PHP WP_Scripts::remove方法代碼示例

本文整理匯總了PHP中WP_Scripts::remove方法的典型用法代碼示例。如果您正苦於以下問題:PHP WP_Scripts::remove方法的具體用法?PHP WP_Scripts::remove怎麽用?PHP WP_Scripts::remove使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在WP_Scripts的用法示例。


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

示例1: wp_deregister_script

function wp_deregister_script($handle)
{
    global $wp_scripts;
    if (!is_a($wp_scripts, 'WP_Scripts')) {
        $wp_scripts = new WP_Scripts();
    }
    $wp_scripts->remove($handle);
}
開發者ID:nurpax,項目名稱:saastafi,代碼行數:8,代碼來源:functions.wp-scripts.php

示例2: wp_deregister_script

/**
 * Remove a registered script.
 *
 * @since r16
 * @see WP_Scripts::remove() For parameter information.
 */
function wp_deregister_script($handle)
{
    global $wp_scripts;
    if (!is_a($wp_scripts, 'WP_Scripts')) {
        if (!did_action('init')) {
            _doing_it_wrong(__FUNCTION__, sprintf(__('Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.'), '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>'), '3.3');
        }
        $wp_scripts = new WP_Scripts();
    }
    $wp_scripts->remove($handle);
}
開發者ID:adisonc,項目名稱:MaineLearning,代碼行數:17,代碼來源:functions.wp-scripts.php

示例3: wp_deregister_script

/**
 * Remove a registered script.
 *
 * @since r16
 * @see WP_Scripts::remove() For parameter information.
 */
function wp_deregister_script($handle)
{
    global $wp_scripts;
    if (!is_a($wp_scripts, 'WP_Scripts')) {
        if (!did_action('init')) {
            _doing_it_wrong(__FUNCTION__, sprintf(__('Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.'), '<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>login_enqueue_scripts</code>'), '3.3');
        }
        $wp_scripts = new WP_Scripts();
    }
    // Do not allow accidental or negligent deregistering of critical scripts in the admin. Show minimal remorse if the correct hook is used.
    if (is_admin() && 'admin_enqueue_scripts' !== current_filter()) {
        $no = array('jquery', 'jquery-core', 'jquery-migrate', 'jquery-ui-core', 'jquery-ui-accordion', 'jquery-ui-autocomplete', 'jquery-ui-button', 'jquery-ui-datepicker', 'jquery-ui-dialog', 'jquery-ui-draggable', 'jquery-ui-droppable', 'jquery-ui-menu', 'jquery-ui-mouse', 'jquery-ui-position', 'jquery-ui-progressbar', 'jquery-ui-resizable', 'jquery-ui-selectable', 'jquery-ui-slider', 'jquery-ui-sortable', 'jquery-ui-spinner', 'jquery-ui-tabs', 'jquery-ui-tooltip', 'jquery-ui-widget', 'underscore', 'backbone');
        if (in_array($handle, $no)) {
            $message = sprintf(__('Do not deregister the %1$s script in the administration area. To target the frontend theme, use the %2$s hook.'), "<code>{$handle}</code>", '<code>wp_enqueue_scripts</code>');
            _doing_it_wrong(__FUNCTION__, $message, '3.6');
            return;
        }
    }
    $wp_scripts->remove($handle);
}
開發者ID:mostafiz93,項目名稱:PrintfScanf,代碼行數:26,代碼來源:functions.wp-scripts.php

示例4: filter_wp_default_scripts

/**
 * Filter wp_default_scripts
 *
 * Removes an extra jQuery Script
 *
 * @since 5.0.0
 *
 * @param \WP_Scripts $scripts The Default WordPress scripts.
 *
 * @return void
 */
function filter_wp_default_scripts($scripts)
{
    if (!is_admin()) {
        $scripts->remove('jquery');
        $scripts->add('jquery', false, array('jquery-core'), '1.12.3');
    }
}
開發者ID:ChrisWiegman,項目名稱:chriswiegman-theme,代碼行數:18,代碼來源:core.php

示例5: array

 /**
  * Register scripts.
  *
  * This will be moved to script-loader.php in #coremerge.
  *
  * @param WP_Scripts $wp_scripts Scripts.
  */
 function register_scripts($wp_scripts)
 {
     $handle = 'customize-partial-refresh-pane';
     $src = $this->dir_url . 'js/customize-partial-refresh-pane.js';
     $deps = array('customize-controls', 'jquery', 'wp-util');
     $in_footer = true;
     $wp_scripts->add($handle, $src, $deps, $this->get_version(), $in_footer);
     $handle = 'customize-widgets-hacks';
     $src = $this->dir_url . 'js/customize-widgets-hacks.js';
     $deps = array('customize-widgets');
     $in_footer = true;
     $wp_scripts->add($handle, $src, $deps, $this->get_version(), $in_footer);
     $handle = 'customize-partial-refresh-preview';
     $src = $this->dir_url . 'js/customize-partial-refresh-preview.js';
     $deps = array('customize-preview', 'wp-util');
     $in_footer = true;
     $wp_scripts->add($handle, $src, $deps, $this->get_version(), $in_footer);
     $handle = 'customize-preview-nav-menus';
     $src = $this->dir_url . 'js/customize-preview-nav-menus.js';
     $deps = array('customize-preview', 'customize-partial-refresh-preview');
     $in_footer = true;
     $wp_scripts->remove($handle);
     $wp_scripts->add($handle, $src, $deps, $this->get_version(), $in_footer);
     $handle = 'customize-preview-widgets';
     $src = $this->dir_url . 'js/customize-preview-widgets.js';
     $deps = array('customize-preview', 'customize-partial-refresh-preview');
     $in_footer = true;
     $wp_scripts->remove($handle);
     $wp_scripts->add($handle, $src, $deps, $this->get_version(), $in_footer);
 }
開發者ID:rheinardkorf,項目名稱:wp-customize-partial-refresh,代碼行數:37,代碼來源:class-wp-customize-selective-refresh.php

示例6: dequeue_jquery_migrate

 /**
  * Dequeue jQuery migrate.
  *
  * @since 1.0.0
  *
  * @access private
  * @param WP_Scripts $scripts Default scripts.
  */
 public function dequeue_jquery_migrate($scripts)
 {
     if (!is_admin()) {
         $scripts->remove('jquery');
         $scripts->add('jquery', false, array('jquery-core'), false);
     }
 }
開發者ID:barryceelen,項目名稱:wp-pimp-my-ride,代碼行數:15,代碼來源:class-pimp-my-ride.php


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