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?
- Display random categories on the front page (Finding and Editing Theme Functions)
- How to get woocommerce inventory status [closed]
- How to use get_template_directory_uri() to load an image that is in a sub-folder of my theme?
- AJAX handler throws 400 (Bad request) – why?
- Is it possible to get a theme customizer setting from wp.customize using jquery?
- Apply jquery script to only woocommerce product pages and categories
- Return only top-level navigation items from a menu using wp_get_nav_menu_items
- Organize functions.php
- How to override functions.php in child theme?
- Replacing select2 in admin backend for all selects
- How to save Uploaded image in custom option panel?
- How do I “unhook” / de-register jQuery so that it’s not called as part of wp_footer();?
- Add inline css to theme
- Dequeue script in template isn’t working
- How to add background image control to page admin controls?
- Ajaxing function in widget class
- woocommerce target button with class after ajax update
- WordPress doesn’t Load JQuery Now? Do I need to enqueue JQuery also?
- Toggle Sidebar Display
- How to call custom function from functions.php in site-wide template files?
- How to use thumbnails in gallery?
- Logic to Print/echo a css class only for 1st post and ignore all post after 1st? [closed]
- How can I change the do_action function in footer (copyright area)
- Loading CDN that requires jQuery in WordPress
- Why does the ‘wp_nav_menu’ function work only until a menu is created?
- wp_register_script(… $in_footer = true) not working
- Right way to update widget on dynamic new input field
- Use register_setting() in a loop
- Add dynamic links in WordPress custom theme
- how can I edit flexslider in woocommerce. [Urgent]
- How to change the order of Jquery in the footer of my theme?
- enqueue styles for only mobile wp
- Attempt to change jQuery version caused White Screen of Death
- Usage of theme name in functions
- PHP mixed with some JS code to update WordPress theme settings
- Load jquery only for certain pages in the backend
- Custom theme, contact form 7 & fast secure form doesn’t work
- ACF not showing
- Which function required?
- 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?
- Remove Custuomize Sections
- Can we create our own theme’s function.php?
- Define PHP variable from a seperate API if statement
- get_pages() Returns Only One Item
- Does size of a theme’s functions.php file matter?
- get_next_posts_link() returns no result despite available posts
- Nav menus all outputting the same links
- 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
- 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
- Passing Jquery value to WordPress function
- How to store a number (coming from cookie) into query vars for later usage in other filters?
- What is the correct way to include my new functions and scripts in WordPress?
- wp_nav_menu work in functions.php but not in the theme
- get content from page through AJAX
- colorbox not loading in
- Get URLs for AJAX Filter Checkboxes WordPress
- How to fix Function create_function() is deprecated in / themes
- WordPress wp_dequeue_script remove all other scripts
- Ajax Form Issues using Lightsail (AWS)
- Can I use ‘Featured Image’ as a hero image and a thumbnail?
- WordPress does not load jQuery
- wp_title() return random number
- How to offset main query without affecting other queries and backend
- Multiple Notifications SetInterval
- How do i create a search option for pdf’s only
- Execute jQuery with custom event listener after successfully add an item to the cart
- How to retrieve image IDs from shortcode content?
- HowTo: Add wrapper to columns shortcode?
- How to create admin ajax function for my contact form
- Class::$template_dir_path=get_template_directory();
- wordpress not calling peliegro functions.php?
- Extend the WP_Customize_Image_Control class to change its non-frame $button_labels
- Language switcher for subdomains
- How to add next height number in Order Attributes inside the Add new page. [duplicate]
- Load a Child Theme’s style.css just before the closing tag
- jQuery HoverIntent is not a function
- enqueue script if page is not equal to
- Ajax call does not work for this custom code
- Add the title of a widget as an ID – for anchor links
- shortcode inside post called by ID does not render as expected
- Add custom css to theme
- AJAX values converted to PHP Variables?
- Why don’t ‘wp_nav_menu’ CSS classes work until a menu is created?
- How to get postId from the argument $block when register_block_type()?
- WordPress is adding pagination for all pages not only for blog page, How to remove pagination for all pages except blog/posts page?
- iOS and ajaxComplete
- Setcookie not setting cookies anywhere except admin