Created
December 1, 2022 07:51
-
-
Save faisalahammad/5e3f45d04d6203d2439d4839a919835c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Replace the numbered months with named months in a Gravity Forms dropdown date field | |
add_action( 'wp_footer', function () { ?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function( $ ) { | |
$('.gfield_date_dropdown_month select option').each( function(i, option) { | |
switch( option.value ) { | |
case '1': option.innerHTML = 'January'; break; | |
case '2': option.innerHTML = 'February'; break; | |
case '3': option.innerHTML = 'March'; break; | |
case '4': option.innerHTML = 'April'; break; | |
case '5': option.innerHTML = 'May'; break; | |
case '6': option.innerHTML = 'June'; break; | |
case '7': option.innerHTML = 'July'; break; | |
case '8': option.innerHTML = 'August'; break; | |
case '9': option.innerHTML = 'September'; break; | |
case '10': option.innerHTML = 'October'; break; | |
case '11': option.innerHTML = 'November'; break; | |
case '12': option.innerHTML = 'December'; break; | |
} | |
}); | |
}); | |
</script> | |
<?php } ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment