If you want to just enqueue a script by name then you have to register it first with wp_register_script:
wp_register_script( 'jquery-knob',
plugins_url( 'assets/js/jquery.knob.min.js', __FILE__ ),
array( 'jquery' ), '1.2.11' );
:
wp_enqueue_script( 'jquery-knob' );
However that’s only really useful when you’re registering a script to be available as a dependency for other scripts, which I don’t think you are here. Instead it’s easier to register and enqueue it in one go, which you should do from a wp_enqueue_scripts hook:
function enqueue_jquery_knob() {
wp_enqueue_script( 'jquery-knob',
plugins_url( 'assets/js/jquery.knob.min.js', __FILE__ ),
array( 'jquery' ), '1.2.11' );
}
add_action( 'wp_enqueue_scripts', 'enqueue_jquery_knob', 10, 0 );
Related Posts:
- Ajax in Plugins: returns the whole page
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- How do I use WordPress PHP functions in my Javascript code?
- How to create popup same as wordpress popup feature
- Best approach to fetch data from wp options to js file or php file
- Custom plugin giving: wp-admin/admin-ajax.php 400 (Bad Request)
- Javascript in plugin not working
- Ajax, jQuery and WordPress
- get_option include in my adsense
- Load css classes after using ajax calls
- Pass PHP variable to javascript
- How to Add a Third Level Sub Menu to the WordPress Admin Menu
- force enqueue script to be first in order of prominence
- How to stop showing admin notice after close button has been clicked
- Is there any record of installed plugins in the database?
- Add content to /wp-admin/plugin-install.php admin screens
- Handling jQuery Component Collision
- Is dynamic forms/entries possible in Widget?
- AJAX Call Via Vanilla JavaScript In WordPress Plugin Development
- Editor not displaying dynamically after clicking on the button
- Check javascript file Proper way in functions.php
- Dequeue / Deregister script and replace it with a new plugin
- Insert code after tag without using functions.php?
- Get image URL from media library in input
- Passing select control value to block
- Only execute jQuery function(on document ready) on the page has shortcode from plugin [duplicate]
- How could I execute my plugin just in frontend (not in backend)
- Handling jQuery Component Collision
- Custom height/width for thickbox in WP Backend
- Hide Theme options and Customize Admin menu
- Check if email address exists front end with AJAX in a plugin
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- wordpress site | All-in-one-cufon IE Issue
- How to add Internationalization in WordPress using Javascript/React?
- Change upload folder for a CPT
- Ajax contact form widget plugin data not insert in database
- Time consuming callbacks in customizer
- Modifying a .js Function for Print [QZ Tray, WooCommerce POS]
- Create tabs in admin options page from custom post type loop
- Redux Framework: Page freezes on typing in Editor
- Using window.onload with Ubermenu
- How can I remove the WordPress-Version (?ver=5.x) from my plugin
- Delay JavaScript files from loading
- “Conflict” with jQuery (or its plugins)?
- How to make multiple admin pages for one plugin?
- How to add an element right after the article using jQuery?
- wordpress add_action() issue in ajax call
- Localizing methods for jQuery append prepend wrap parent
- Save user total active time after login in wordpress [closed]
- WordPress Site is Broken, Cannot see wp-admin page [closed]
- How to remove a CPT Menu from the Root Admin only
- Why does my jQuery plugin show up as text in WordPress?
- How do I make sure that my plugin only runs on article detail pages?
- Disable submit button order
- jQuery code didn’t run on my plugin
- The Events Calendar Plugin – List View Background Colour Issue [closed]
- how to request a script more than once in wordpress
- Ajax request sends url rather than data
- Adding a jQuery modal dialog to the admin area
- I cannot include a file in my plugin settings page
- Pass PHP variable to javascript
- Trigger jQuery to add events after AJAX-loading table in admin plugin
- wc_get_template_part doesnt display the content [duplicate]
- force logged in user to stay in the dashboard
- login form should redirect to register page for in 1st login next time it should redirected to home page
- Cannot run script properly with my custom plugin
- Ajax Call not Working in Plugin
- How to get a specific string from a url
- Does anybody know how to insert a complete jquery plugin into a wordpress elementor-page?
- JS working when used normally but not in wordpress
- update_post_meta is not working for me when I use e.preventDefault for update button
- Problem with wordpress has_action() function
- AJAX update fails for public/non-admin users
- WordPress Ajax request “Failed to load resource: the server responded with a status of 400 ()”
- WordPress Thickbox Navigation Issue in Gallery
- Admin menu hilighting wrong item for CPT
- Dynamic input fields in WordPress Plugin
- Is admin section completely customizable in terms of styling?
- WordPress ajax error 400 bad request for sending data to remote site [duplicate]
- Not displaying Woocommerce product page in lightbox
- How to pass value from WordPress to Javascript
- show-hide based on select option jquery wordpress
- Creating a user ‘add custom field’ section
- WordPress ajax not working in registration
- How to add jquery to my custom post type wp plugin
- Possible jquery / library conflict in plugin usage
- Why won’t the Comprehensive Google Map Plugin load?
- Plugin – including external javascript calling google maps
- Add custom fields in the new and edit the site forms without touching the WP core
- Element works, but not on wordpress site [duplicate]
- Combining JS files to one script
- How to create post comparison in wordpress
- FacetWP: Plugin breaks button/modal functionality inside searchable content area
- TypeErrors with Yoast, jQuery in conflict?
- Javascript as Jquery Function Call?
- Count div with class (.length) only shows 0 [closed]
- Jquery post responses 500 error after some time and lastly an 503 error
- The Admin page isn’t showing in the sidebar of the dashboard
- Submitting form to admin-post.php WordPress
- Vanilla javascript in custom gutenberg block not working