You can use the script_loader_tag
hook
function enqueue_validation_script() {
wp_register_script( 'validation', 'https://www.asd.in/script.php?id=3ff00a469474bbe71a9218a7f0377518', array( 'jquery' ) );
wp_enqueue_script( 'validation' );
}
add_action('wp_enqueue_scripts', 'enqueue_validation_script');
function add_id_to_validation_script( $tag, $handle, $src ) {
if ( 'validation' === $handle ) {
$tag = '<script type="text/javascript" id="3ff00a469474bbe71a9218a7f0377518" src="'.$src.'"></script>';
}
return $tag;
}
add_filter( 'script_loader_tag', 'add_id_to_validation_script', 10, 3 );
Related Posts:
- Move jQuery and Migrate to footer?
- is_customize_preview() like function to check if Customizer “Live Preview” in JavaScript
- How to load jQuery in the footer – nothing works for me
- Jquery implementation not working on page reload
- Why a SlideShow (made using JQuery FlexSlider) can’t work if I load it form functions.php but work if I load it from my footer.php file? [closed]
- Moving CDN jQuery to footer does not work?
- How to disable controls in theme customizer?
- Load jquery only for certain pages in the backend
- Functions.php Problem
- Change CSS for logged in users
- Always the Latest google jQuery instead of default WordPress jQuery
- Add a jQuery Function
- jQuery does not work
- Custom theme, contact form 7 & fast secure form doesn’t work
- ACF not showing
- using jQuery on only one page
- How to customize the_archive_title()? Cannot figure out how to change the value it produces [duplicate]
- Which function required?
- Can’t call Javascript function – scope?
- Control the srcset much more (not all sizes in it each time)
- Changing parent element’s class or style
- Check if the image size is available and if not use ‘full’ image size
- Way to store featured image width and height in two separate variables?
- Enqueuing latest version of jQuery into a child theme returns a blank screen
- Remove Custuomize Sections
- Can we create our own theme’s function.php?
- echo custom fields with AJAX
- Define PHP variable from a seperate API if statement
- Excerpt for pages not showing
- get_pages() Returns Only One Item
- Adding jQuery datepicker to Custom Post Type Metabox [closed]
- Some questions about how proper add 2 CSS file in a WordPress theme?
- In jquery use php variable to execute an enqueued jquery file
- JQuery undefined and Stylesheet loads in bottom along with js files
- Theme not calling Jquery properly
- Run a jquery script on on a certain template page
- Add php code to wp_print_scripts?
- Does size of a theme’s functions.php file matter?
- Functions php shortcode for displaying main menu with no child items
- Insert nofollow in a “Powered By” link, except in the homepage [closed]
- get_next_posts_link() returns no result despite available posts
- Nav menus all outputting the same links
- How can i unload effect.min.js file?
- PHP 7.1 | Warning: A non-numeric value encountered in
- wp_enqueue_script | Help me figure out what is causing jQuery is not defined
- How to insert class in each list of categories?
- I can’t add CSS with functions.php
- Where is this JQuery coming from?
- Check from functions.php if function exists in footer.php
- This code works, but the way I integrated it is breaking the media uploader. How can I integrate it properly?
- Getting the teaser text without overriding global variables
- Combine two active_callbacks into one on theme customizer
- Auto scroll to id on page load on all pages except home page. Only do this on mobile
- WP Customizer API loaded into functions.php
- call_user_func_array() expects parameter 1 to be a valid callback, function
- why can’t i add front.css to my frontpage.php
- How to load jQuery in TOP of wp_footer?
- Passing Jquery value to WordPress function
- “options.php” not found
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- WordPress can’t get jquery/unslider to work
- Is this an acceptable practice for WordPress theme development?
- Add loggedout class on body using a function or JS
- Are innerHTML elements visible to jQuery functions?
- What is the correct way to include my new functions and scripts in WordPress?
- Include Jquery libraries in wordpress theme?
- wp_nav_menu work in functions.php but not in the theme
- Rewrite Question Mark in Post Template with URL Parameter for clean URLs
- contact form in template with jquery,validate and ajax
- Why I can’t load my JavaScripts using an hook inside my functions.php file?
- get content from page through AJAX
- Creating multiple category drop down
- How to setup a popup registeration page in wordpress with function.php
- colorbox not loading in
- How to add php within jquery
- Help with IF has focus then… statment
- Get URLs for AJAX Filter Checkboxes WordPress
- Woocommerce Variable Product Dropdown for Custom Shop Template
- How to fix Function create_function() is deprecated in / themes
- Exclude specific post from query
- wp_set_object_term via js btn frontend
- Advanced method to control cache of enqueued style/script
- WordPress wp_dequeue_script remove all other scripts
- Populate Product Regular Price with a calculated ACF Field Value
- Hide ‘add to cart’ when certain value in dropdown is selected
- Ajax Form Issues using Lightsail (AWS)
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- What is the earliest Hook a Script can use?
- WordPress does not load jQuery
- post value to function with Ajax and jQuery
- Is_Page doesnt detect my page
- Test CDN link from function.php or wp_enqueue_script/style?
- How to customize archive widget only for cpt?
- wp_title() return random number
- Why does echo on functions.php not yield result in source code?
- Images with overlay
- How to offset main query without affecting other queries and backend
- wp_footer hook causing text to show on bottom of page
- How to use `foreach()` in ajax call
- Add meta data in head from theme