I can’t find a nice way of doing it though wp_script_*, but you can go to the global directly:
global $wp_scripts;
$version = $wp_scripts->query( 'jquery' )->ver;
Here the query
returns the script’s _WP_Dependency
object, and then we can get the version from it. (Annoyingly wp_script_is( ..., 'registered' )
fetches the _WP_Dependency
but then casts the result to a bool to return.)
This only works for registered scripts; apologies I don’t know the distinction, but AFAICS a script can only be queued if it’s registered, and it’s only the registered data that holds the version.
Related Posts:
- Autoloading & Namespaces in WordPress Plugins & Themes: Can it Work?
- How can I add an image upload field directly to a custom write panel?
- Creating a table in the admin-style?
- Looking for WordPress System Diagrams
- How to output message during plugin activation
- On the WordPress Admin section how do I link to submenu pages created for a plugin?
- How to return only certain fields using get_posts()
- How to provide translations for a WordPress TinyMCE plugin?
- Scheduled events disappear from events queue
- Where do I start from
- Where is it better to start learning how to develop for WordPress?
- How to log plugin errors to plugin error_log file
- Custom Post Type Link from Plugin
- Cron firing my function everytime wp-admin is visited
- Formatting of curly brackets array from WP database to get more readable output
- How to find attachment ID for first image in a post
- Multiple textdomains
- Dynamically Override Fancy Title
- update_option is not working!
- What URL do you pass to wp_remote_get to load the body of the current post’s preview?
- wp_enqueue_style built in styles
- Override pluggable functions in a plugin?
- Set a specific page as 404 – not found via my own plugin
- Adding Automatically To In WordPress Using Filter Referencing?
- How do I create a custom api endpoint?
- Add tab to profile.php wordpress plugin development
- Sharing a common set of image files for media library, across all sites within multisite
- Plugin update not reflected in WordPress plugin page
- How do I alter the comment form ‘allowed tags’ text in a plugin?
- Best plugin for most viewed post [closed]
- What could cause my plugin’s options/settings page not to load?
- Error : “Cannot use object of type WP_Post as array in”
- How to remove images from my plugin page in WP Directory?
- How to show active version on wordpress.org of a published plugin?
- How to create database table, add data, update and delete using wpdb via plugins?
- Find out Requires WP tag for a plugin when submitting it
- Extending theme PHP class in plugin
- Any ideas to trigger some code after plugin update?
- Is there an additional block.json property to set to get an InnerBlocks child to respect the “supports” property?
- WP Editor Issue in Backend
- How to test plugin update through WordPress plugin updater without tagging new release in the repo
- On the .org repo, can your plugin name/slug contain “WooCommerce” [closed]
- Wrap text around shortcode
- WP and object persistence (or lack thereof)
- UWooCommerce – add cart discount programmatically?
- Checked() function on a multidimensional array
- Bad Request in AJAX
- Remove sidebar on single page using plugin API
- When does save_post hook fire on post save/update
- Enqueuing scripts and styles in custom plugins
- Include file in plugin file
- Shortcode not appearing when used as post content in wp_insert_post() or possibly, shortcode not being registered at all
- Plugin language always shows WP site language, not profile language
- Creating two tables in database on activation hook
- Adding custom stylesheet into header.php using a plugin
- Developing the save function in Gutenberg blocks
- Creating an installation zip file
- update_callback is not working in register_rest_field
- Detect change in site_url and home_url
- Reporting errors in a shortcode plugin
- Adding Custom CSS with PHP
- Why is the form not updating when I select a new sector from the list?
- How to remove/replace current page template?
- How do I add a menu item to a Pods admin menu?
- Is there a way to add a link with add_post_meta?
- How to receive notification of deprecated API elements and functions?
- Using password protection to load different page elements?
- How to Show Category List With Corresponding Links?
- Change reminder email date to 14 days before
- .htaccess with WordPress – create my own pretty url with parameters (above WordPress settings)
- Import images remotly run through timeout error
- Generating a password-protected front-end page via a plugin
- How do I add a 5 digit ZIP code validation to a Contact7 form?
- HTMLCollection not counting right in editor? / for loop not working on elements in DOM
- wp_remote_post not working with admin-post.php
- How can we stop showing short code in create or edit post section
- WordPress Own Rewrite Rules
- Default media uploader is not showing in wordpress website
- Delete Plugin Options with Verify
- Load custom translation in custom plugin fails
- Buddy Press restrict the capability to edit users
- “Headers Already Sent” Nightmare on Plugin
- set a custom post type to a taxonomy term programmatically in metabox
- Uncaught ReferenceError: kpoejy is not defined
- How to get an array out of a nav menu if it’s a plugin?
- Is there better way to do this without duplicating queries?
- How to create a simple plugin which show/hide an html code in wordpress?
- How to display properly exception or echo string after posting in plugin?
- How to create custom frontend php page via plugin
- How can I add recent posts to menu like mashable
- Translation of plugin Upload button
- Changing upload directory for plugin uploads only
- Create wordpress dashboard metabox which spans all columns
- How do I query posts and have their related taxonomies returned in the results?
- add_filter adds output in the head
- How can i add insertion point between inner blocks in my custom block like core blocks
- Update option hook not firing
- $_GET vs get_query_var()
- How do I modify the error code array used by “shake_error_codes” filter?
- How do I add multiple custom menu Woo-commerce my account page?