You can do this with the function get_bloginfo(). There is a special paramater called version that retrieves the wordpress version from the $wp_version variable set in wp-includes/version.php.
So you could do something like this
function register_jquery_wp_version() {
global $wp_version;
if ( $wp_version >= 3.8 ) {
// register and enqueue jquery A
}elseif( $wp_version >= 3.9 ) {
// register and enqueue jquery B
}
}
add_action( 'wp_enqueue_scripts', 'register_jquery_wp_version' );
Related Posts:
- Get only enqueued styles and scripts of the current theme
- Trigger a php file on every post or page if a condition is met
- Enqueue less file not working in child theme?
- Execute only on a certain page
- How to execute a simple php script in WP (I don’t think wp_enque_script applies here)
- Is it recommended to pass some data to scripts in `wp_enqueue_scripts`?
- if file_exists not working with wp_enqueue_style
- enqueue hover function
- Adding tawk.to code just before body tag on functions.php file
- How to enqueue CSS and JS only on specific template?
- Deregistering a script in WordPress seems impossible
- How to inject variables into public-facing JS using wp_enqueue_script
- How to only enqueue script if it’s a post
- WordPress Scripts Being Loaded in Footer
- Jquery function working in Dev Console but not otherwise [duplicate]
- jQuery code not working when included in functions.php
- Is the wp_enqueue method efficient?
- Correct way to enqueue page specific CSS file
- linking stylesheets and scripts with functions.php
- Double jQuery loaded
- How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)
- How to use wordpress function wp_enqueue_script() in php?
- Enqueing External JS on the remote server JS
- Trying to enqueue script – Nothing Happens
- url_to_postid returns 0
- ‘Bones’ theme: Load stock scripts in footer instead of header?
- Enqueueing a code block from an options framework
- Ajax on the Administration Side of plugin – wp_localize_script – how to pass value from JQuery to PHP function in class?
- Using Google Analytics in an enqueued JS file
- Enqueue assets from multiple directories using add_action/do_action
- How to change order inside foreach using wp_enqueue_script?
- Call a single function on two different methods with hooks
- Enqueue sripts and styles only if function is called
- Load script and styles using an array of resources
- Importing the style and scripts in the plugin doesn’t work as well as in the theme
- When to use wp_register_script() function?
- How to stop loading my custom scripts files for wordpress iframe?
- How can I enqueue comment-reply script only on certain page?
- Chosen Select jquery Not Working in Plugin
- Adding javascript files to WordPress and jQuery version
- How can I print out a single stylesheet or javascript link?
- Adding Gravity Form With if(is_page) Is Not Working
- wp_enqueue_style conflict when using in different action hooks
- Errors while Loading Most Recent Version of jQuery
- Warning: filemtime(): stat failed for wp_
- How to enqueue structured data as file – jsonld file seems not to work
- Make a variable global and use it for inline script
- functions.php doesn’t load all custom theme assets
- in_footer: gives syntax error
- WordPress generating Undefined Variable warning
- Matching a space in regex
- Undefined function mysql_connect()
- How can I call WordPress core functions in external scripts?
- Conditional Statement – check if post has an attachment image
- WooCommerce – Customer Order History Pagination
- submit the form to same page
- How can I add a custom class to only nav sub-menu > li > a items in WordPress?
- WooCommerce – Email admin with new user details
- Detect session/cookie variable in wordpress to prevent access to documents
- How to VAR_DUMP a $variable during checkout process (Is my product meta callable?)
- How to implement a rating and review system for WordPress custom posts?
- Set Order Status to Complete After Payment – from another site
- php function to display commenter username or login
- Can anyone offer any help with this function?
- Changing the_posts_navigation() html output
- Hide a div when tags doesnt exist [duplicate]
- What does -> mean in WordPress?
- First Byte Time (back-end processing)
- How to update and save user metadata on page visits?
- Generate CSV file and add data as a new wordpress custom post
- Add URL parameter to all internal links using a specific theme
- Call featured image url
- select wordpress custom post type
- WordPress 6.0 class-wp-widget.php fatal errors in PHP 8.1.6
- Unserialize Custom Field & Save as Multiple Rows in WordPress Database
- Add a product category to a specific product via a button
- Creating a checklist with ACF and I cannot figure out how to add all iterations to an array that I’m creating
- register_setting not save checkbox
- Add Product Permalink in woocommerce admin order page
- Proper use of Output Buffer for a whole php clas
- How do I make comment-reply-button with that takes to comment reply form on click
- Allow user to choose header style
- Require advice handling a URL redirect from a Third Party. URL Params need to populate and then forward to payment
- ERR_TOO_MANY_REDIRECTS / To Force SSL Logins and SSL Admin Access
- Not able to add new item in wordpress home page
- How to apply filter
- How to find the function which is outputting Array
- Contact form field in wordpress menu
- How can I include a file related to blog URL? Nothing seems to work
- How Can I Center the Logo in the Navigation Menu? [closed]
- Where are Sessions are being started? [closed]
- Object of class WP_Post could not be converted to string while trying to console.log wp_get_nav_menu_items
- Check radio get value to array
- Your PHP installation appears to be missing the MySQL … After deleting and restarting from cpanel
- How to create shortcode of this PHP code
- Automatically change insurance quantity based on cart total [closed]
- I want to lists posts in wordpress to nearest location entered by the user
- footer doesn’t display
- id for categories and products
- Remove slug of multiple custom post types with and without hierarchical