Skip to content

Instantly share code, notes, and snippets.

@dragipostolovski
Last active March 31, 2021 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dragipostolovski/54f61950c85783e6714607cca817ba82 to your computer and use it in GitHub Desktop.
Save dragipostolovski/54f61950c85783e6714607cca817ba82 to your computer and use it in GitHub Desktop.
<?php
// Wrap two adjacent elements in a containing div using jQuery.
function pe_load_js() {
?>
<script type='text/javascript'>
jQuery(document).ready(function ($) {
$("#billing_customer_age_field span input").each(function(index) {
$(this).next("label").andSelf().wrapAll("<div class='efp-form-element-wrapper' />")
});
});
</script>
<?php
}
add_action( 'wp_footer', 'pe_load_js');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment