Yes. Dependencies work across all of WP, it doesn’t matter where you enqueue your script. All that matters is that you define your dependencies correctly, and you’re doing that.
If, however, you plan to publish both the theme and the plugin as standalone versions, you shouldn’t rely on your plugin being used with your theme, and add the same script to your plugin (using the same name so it’ll only be loaded once by WP). If theme and plugin are only available as a combo, don’t worry about it.
Related Posts:
- ajaxurl not defined on front end
- How to include jQuery and JavaScript files correctly?
- jQuery in header or footer
- WP Plugin Running before jQuery
- Why does WordPress use outdated jQuery v1.12.4?
- How to add a javascript snippet to the footer that requires jQuery
- How to Add a .js file Only in one specific Page Dynamically to Head
- Use js script from one plugin in another plugin
- What is the difference between these two methods of writing $ instead of jQuery in WordPress [closed]
- How to avoid loading same script twice?
- WordPress custom taxonomy check box to dropdown
- jQuery does not enqueue for my purpose… (before an inline script in the footer)
- should i be checking for jquery before enqueing it in a plugin
- How to enqueue scripts in right way in a plugin?
- unable to wp_enqueue_script(‘suggest’);
- Ajax: Populate with content from a post’s ID not working – duplicating current page html instead
- Loading Images from Javascript on the Front End
- Add a Script button in W3 Total Cache plugin not working due to conflicting jQuery version
- Script work on non logged in user but not work for logged in user?
- Loading jQuery library from WordPress admin
- How to get the value entered in the input field in wordpres
- How react js and other Javascript Technologies works on WordPress plugin?
- Replace “content-area” of themes 404 page with plugin?
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- Javascript not being loaded only in custom taxonomy template
- wp_ajax add_action fuction won’t fire on custom jQuery action
- Filterable posts using categories
- How to get values from Tinymce visual editor popup?
- set a custom post type to a taxonomy term programmatically in metabox
- Ajax Response Error | just getting error as the response
- Custom premium registration form and profile page for a WordPress Web Application
- redirect_to how to make it simply work with get parameter or similar?
- Enqueue scripts based on site.
- My enqueue admin style function doesn’t work because of ?=ver
- Determine if the current page, is being edited
- Can i prevent the effect of the_title filter on the dashboard’s posts/pages titles?
- replacing jquery google cdn with a new version dynamically
- How do I make two shortcode use the same id and increment it when I use them multiple times?
- How to enqueue an external Javascript file to Frontpage footer
- WordPress function is not called and ajax return 0
- Is it possible to modify an Elated plugin portfolio-list template in such a way that it will not conflict with future plugin updates?
- How to embed or integrated a custom WordPress Widget into the theme?
- Post Pagination does not working on WP-Query
- How to destroy or dispose wordpress uploder/manager?
- Ajax call not working with
- How to CRUD from wordpress database in wordpress theme?
- Woocommerce Custom Checkout
- Dynamic sidebar areas not working on the Theme Customizer
- Caption Shortcode: what filter to change the image size?
- Looping single post in a theme
- Font Awesome stopped showing icons, shows &# text instead [closed]
- How can I add the Post ID to Class Name in Jquery?
- Enqueue script not working
- Merge Codes using redux framework
- To remove rendering of menus and header, plugin or theme?
- To remove rendering of menus and header, plugin or theme?
- Managing Custom Designed Content
- Template file structure , wordpress hook for altering the template
- WordPress permalink setting
- Custom theme and plugin updating
- Issue on Getting Images URL of the Post Gallery
- Best practice: What belongs in theme and what in plugin for large eCommerce website
- How can I add recent posts to menu like mashable
- Is there a general way to get a themes primary colour?
- variable created in page.php is null inside of header.php
- Issue on Getting WP Gallery Items In cpt-single.php As Attachments
- Generate activation url
- Adding class to the parent of current-post-ancestor / current-menu-parent / current-post-parent
- problem with blank page
- How do I call the dashboard’s sortable javascript in a plugin page?
- How to Register/Link to .js Files in WordPress Dynamicaly in Header.php
- grouping my widgets wordpress
- Display Data’s metabox in page
- Updating Style From WP Options Setting Page
- Cannot echo a JS variable to a jQuery plugin coming from wp_localize_script
- enqueue script if page is not equal to
- Ajax functions – no access to wp-admin.php only online
- Create and style menu
- WordPress Beginer to Guru [duplicate]
- Saving multiple fields as array
- Page reload occurs before request finishes
- Why does this fail: Disabling plugins enqueue_script() in functions.php
- If I want to create new taxonomies (e.g. Project / Documents / Etc…) is it better to create them in the theme’s functions.php or within a plugin? [duplicate]
- Enqueue Script in custom plugin before other
- How to add something after a function
- append code after the_content not working
- How can I make my website with wordpress having on-spot editing feature as compared to concrete5 CMS?
- Problem with Poedit [closed]
- Best Way to Inventory the Media Library of a 200+ Multisite Installation?
- Theme now uses require.js and enqueue script no longer works
- How to only Load scripts on variable products page
- Using tag or inline style attribute?
- How do I use (or mimic) document.getElementById() on a page loaded from WordPress database?
- how to insert content into wp_head after loop_end
- Integrating WordPress Content into a jQuery Slider
- Is Explicit Versioning a better alternative to Semantic Versioning for wordpress?
- Invalid Menu Items
- how many rupee or dollar charge to client to make theme [closed]
- Gutenberg text field validation
- how to catch a data from a array in WordPress