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 a WordPress Hook to Filter the Edit Posts View?
- Is there any record of installed plugins in the database?
- Hook the Keydown Event in the TinyMCE Post Editor
- Add content to /wp-admin/plugin-install.php admin screens
- Handling jQuery Component Collision
- Custom admin column disappearing when using Quick Edit [duplicate]
- How do I only load a plugin js on it’s settings pages?
- Is dynamic forms/entries possible in Widget?
- AJAX Call Via Vanilla JavaScript In WordPress Plugin Development
- Plugin Development: WordPress processes twice on post update. How to skip process on the first?
- Editor not displaying dynamically after clicking on the button
- How to fetch serialized data from wordpress options
- how to not show plugin in admin area
- How to Reload the Dashboard After Clicking Update in Quick-Edit?
- Check javascript file Proper way in functions.php
- Ajax call doesn’t work in frontend but it’s working in backend (when I’m logged in)
- Dequeue / Deregister script and replace it with a new plugin
- Why is my ajax call refreshing the page?
- Insert code after tag without using functions.php?
- Admin-ajax.php is dying “0” without processing function
- 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]
- Has anyone used require.js for handling plugin scripts?
- How could I execute my plugin just in frontend (not in backend)
- Passing RichText attributes to function onChange
- How do I store information in a dynamic block in WordPress?
- jQuery function didn’t work in my plugin
- 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
- ‘wp_login’ action hook not working with wp-login.php file
- Pass a php string to a javascript variable
- Problem in loading javascript in footer
- JQuery not working in my plugin [closed]
- How to load plugin after page is loaded – pagespeed issues
- Get IDs of Images from Gallery Block in InnerBlocks of a Custom Gutenberg Block
- React JSX in WordPress Plugin Development
- Pulling data from custom plugin settings using PHP shortcode and Javascript
- All Users > User List > Update User Meta Field Inline
- Can someone please tell me what is wrong with my plugin?
- Updating the Drag-To-Share eXtended share URLs?
- wordpress site | All-in-one-cufon IE Issue
- Enqueue WordPress plugin scripts below all other JS
- 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]
- wp.media javascript issue with on select
- jQuery for custom plugin not working with Divi theme
- Create tabs in admin options page from custom post type loop
- Redux Framework: Page freezes on typing in Editor
- How to prevent plugins from loading jQuery
- Using window.onload with Ubermenu
- How can I remove the WordPress-Version (?ver=5.x) from my plugin
- Create shortcode to echo javascript
- Redirect to another page using contact form 7? [closed]
- Add style to body based on url
- 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
- Website always load twice on start
- Problem with wordpress has_action() function
- Multiple image selection custom widget
- Create a form and have custom menu display based on user answers?
- 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?
- How to solve Blocked a frame with origin from accessing a cross origin frame error in wordpress?
- WordPress ajax error 400 bad request for sending data to remote site [duplicate]
- Store admin page into variable
- Overwrite js code using WP_Footer
- Not displaying Woocommerce product page in lightbox
- How to use information from the database in the front-end?
- Overwriting Plugin’s Ajax callback function from theme
- How to pass value from WordPress to Javascript
- Storing Array of values into wordpress options
- Can’t find variable is_single in my jQuery plugin
- show-hide based on select option jquery wordpress