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?
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- What process do you use for WordPress development? [closed]
- What is the advantage of using wp_mail?
- Should I create a theme or a plugin?
- Where do I start from
- WP 3.3 Tooltips API?
- wp_remote_get doesn’t work with secure connections https?
- How to Use WordPress Color Picker API in Custom Post Type Metabox
- Custom theme sufficient or custom plugin neccessary for this feature set?
- wp_enqueue_style built in styles
- Admin-ajax.php appending a status code to ajax response
- wp_enqueue_script being ignored in custom theme
- Paging on a future post loop?
- Problem with is_active_sidebar?
- Mixing Regular Javascript With jQuery in a Plugin
- How to run a external JavaScript file on wp-admin if admin, and other if normal user?
- Change template dynamically
- Replacing Scripts in Admin Load_Scripts
- Get Current Menu Location inside Nav_Walker
- Howto: Use Custom Post Types as Submenu Items in Admin
- Extending theme PHP class in plugin
- what is the difference between these phares?
- jQuery for custom plugin not working with Divi theme
- How to limit number of number of categories displayed by categories widget
- How to load library scripts in admin from plugins in noConflict wrapper?
- Create shortcode to echo javascript
- Plugin is not generating title tags on any pages or posts
- Is it necessary to do validation again when retrieving data from database?
- Update Data parameter of a wp_localize_script() call
- get_the_tags with separator control?
- How to only load css for used blocks on frontend
- Add child pages to submenu automatically
- My stylesheets are not enqueuing
- Enqueuing scripts and styles in custom plugins
- Why in this archive page that call query_posts() function show only the last 10 posts?
- Jquery was not found on this server
- Why would you use esc_attr() on internal functions?
- Invalid hook call on save, not edit when using swiper slider
- Data not insert and update through ajax and jQuery in admin page?
- WP ajax requests not stacking?
- How to find where an object first instantiatiation
- Insert Into Post Not Working For Audio File Using jQuery
- Full documentation about $args for register_rest_route?
- jQuery UI tab does not work in the plugin page
- Using HTML links within translatable string
- How to overwrite iris color pallates from theme to plugin
- How to get terms for taxonomy
- Thickbox in Plugin settings page?
- How to remove/replace current page template?
- Adjust query on single
- Using password protection to load different page elements?
- Get cat parameter from admin-ajax
- wp.media gallery collection sometimes undefined
- how can i remove js file from my footer in wordpress
- $ is not defined [duplicate]
- Can’t upload image via submitting custom post from frontend
- Need Help to make a logic for editing posts in Frontend
- How can we stop showing short code in create or edit post section
- WordPress Ajax not returning Response
- Error Connecting to Database WHEN Installing WordPress on XAMPP [Tried All the Usual Stuff] (Pics Included)
- How do I ensure I can loop through every enqueued script and CSS?
- How can I measure CPU and RAM used by my theme or plugin
- Javascript not being loaded only in custom taxonomy template
- set a custom post type to a taxonomy term programmatically in metabox
- Enqueue scripts based on site.
- My enqueue admin style function doesn’t work because of ?=ver
- replacing jquery google cdn with a new version dynamically
- Enqueue script not working
- To remove rendering of menus and header, plugin or theme?
- How can I add recent posts to menu like mashable
- enqueue script if page is not equal to
- How to only Load scripts on variable products page
- Using tag or inline style attribute?
- how to insert content into wp_head after loop_end
- how to catch a data from a array in WordPress
- How are themes and plugins localized using the gettext GNU framework?
- Is there any other ways to replicating changes on live from staging without pushing from git
- Fetch Custom Woocomerce filed data and check the data avialble in Wp-user table as nicname or username using function.php