Scripts should be enqueued on wp_enqueue_scripts
action hook, which runs after init
action. So dequeuing on init
won’t work because sripts are not enqueued yet. Before enqueued scripts are printed, wp_print_scripts
action is triggered so you can dequeue or unregister scripts safely at this moment:
add_action( 'wp_print_scripts', 'drw_timelinr_dequeue' );
function drw_timelinr_dequeue () {
wp_dequeue_script('jquery.timelinr');
}
add_action('wp_enqueue_scripts', 'drw_timeline_js');
function drw_timeline_js () {
wp_enqueue_script('jquery.timelinr2', get_template_directory_uri() . '/js/jquery.timelinr-1.0.js', array( 'jquery' ));
}
Related Posts:
- How to avoid redefining requirejs in plugin when another plugin also uses requirejs
- Edit all $wp_scripts at once to $in_footer = false
- Edit all $wp_scripts at once to $in_footer = false
- Trying to use wp_register_script/style and enqueu them from an array – getting an error [duplicate]
- WordPress 3.8.3. custom theme – sliders won’t load js/css files
- How can I position ShareThis buttons manually when using the plug-in? [closed]
- How to require users to login when not logged in
- Error when using plugin QuickCache with plugin Mobile Smart ? [closed]
- Does WP delete deprecated plugin/theme files on plugin/theme upgrade?
- How can I remove the WordPress-Version (?ver=5.x) from my plugin
- Create shortcode to echo javascript
- Is there any hook for theme activation ? or something similar?
- How to use get_template part in the plugin?
- How can I use get header from within my plugin?
- How do I find out what is in control over a certain part of a website?
- “No Add Button” for me to customize my WordPress with themes and pluggins
- Is there a loading priority for login_enqueue_scripts?
- How do I combine a theme with a plugin
- How can I list all installed plugins/themes/versions from CLI/API?
- My single.php page does not show the related data to the post which is clicked
- Where are theme codes located for WordPress?
- Overwrite category head title
- Basic gallery plugin suggestion [closed]
- Is there a way to get plugins and themes not built for multisite to work on a network subsite?
- How to check if my wordpress websiste is nulled or not?
- Why does my file_exist check fail?
- Remove specific plugins and themes from the Dashboard->Updates page [duplicate]
- Create a single website with 3 theme options in wordpress
- using do_shortcode
- Why am I unable to load scripts in head in plugin?
- Create custom pages with a plugin
- Deactivate JS Script in Plugin Shortcode
- How to write “alt” tag in image for wordpress code?
- Does heavy theme and plugins affect server’s response time? [closed]
- How to protect WordPress from security scanner [closed]
- How to load different homepage on Mobile.?
- Remove / overwrite some functions in buddypress.js
- How to get menu location in wp_update_nav_menu hook
- Proper way to use plugin functions in functions.php
- How to activate a plugin on the activation of a theme?
- Theme Custom Pages
- Use different single.php file based on condition
- how can I query all wordpress users of a blog
- how can I do something on new user registration?
- WordPress plugin won’t show on some themes
- Making that Admin Bar transparent or a blue color
- Which wordpress theme is compatible Optima Express theme (real estate inventory) plugin?
- How to Include File from Plugins into Template?
- how to activate a plugin inside a theme
- how remove font to increase site speed load
- Add type to enqueued script inside plugin
- How to execute plugin and theme updates from a web hook / endpoint?
- wp_dequeue_script for a Plugin
- Use $variable from file1.php in file2.php (different file paths)
- There has been a critical error on your website – won’t fix no matter what
- How to make a dynamic css class whose name changes every visit to confuse scraper
- Is it possible not to load theme on a specific page in wordpress?
- How to get theme’s info from wordpress.org/themes using api.wordpress.org?
- Override/ignore CSS from active theme as not to interfere with my custom CSS
- I receive taxonomy id
- To perform the requested action, WordPress needs to access your web > server
- How to find the list of custom post type where logged in user is author
- What is the purpose of WP_CONTENT_URL?
- How to translate WP Blog (search, category etc.)?
- Theme My Login Shortcode Doesn’t Return Anything
- issue in wp_localize_script
- Include Minit plugin in theme [closed]
- How do I set up XAMPP to allow me to download plugins and themes?
- How to extract a .wp-env.json or composer.json containing plugin versions from a production website?
- How do I add a plugin dependency to my customized theme?
- Moving FB comments at the end of page
- Custom plugin – load enqueue only for this plugin
- How to include files relative to a file’s directory
- How can I use my custom wordpress theme on two websites? [closed]
- How to remove products-links after the product title using remove_action
- How Do I Uninstall a Current WordPress Theme and Install a Fresh Theme
- why need theme,if page builder is there in wordpress [closed]
- Licensing options for WordPress Plugins
- What is it and from where it is loaded?
- speed up pagination for huge database
- Can I filter a function created by a theme or a plugin?
- How I update WordPress theme and plugins
- Inserting Plugins Into Blank Space of Externally Designed WordPress Theme
- Enqueue script: link not working in page source
- Override css rules of a plugin within my own theme
- Deregister scripts from plugin
- Overwrite add_image_size defined by theme
- I want to use wordpress themes and plugin to develop website
- Custom CSS not being added by plugin
- Don’t load the theme for a page FROM a plugin EDITED
- Extending a theme: build new features as plugin or core modules?
- Blocking Plugin Css to load custom in template directory
- Cannot add edit themes and add plugins after multisite update
- Detect plugin/theme installation (via upload)
- Load CSS files in header of Bones theme?
- How to check homepage contain blog post?
- how to design change in woocommerce cart page and all other page also by theme? [closed]
- How to handle a WordPress blog with articles in different languages?
- is there a way to pass a parameter to a add_menu_page function?
- Is it possible for a plugin to prevent certain plugins from being installed?