Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- This snippet changes a datepicker option values for a specific datepicker field, edit the .input-field-dates to your specific form class names.
- For installation instructions, please visit http://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/
- */
- function my_em_datepicker_vals(){
- ?>
- <script type="text/javascript">
- jQuery(document).ready(function(){
- var date = new Date();
- //in this example, we're going back 19 years for a specific field
- date.setFullYear( date.getFullYear() - 19 );
- //.input-field-dates is a class assigned to the encapsulating wrapper tag around the date fields, check your source code for your specific class name
- jQuery('.input-field-dates .em-date-start').datepicker('option', 'minDate', date);
- });
- </script>
- <?php
- }
- add_action('wp_head','my_em_datepicker_vals',1000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement