• If your theme isn’t already importing the Datepicker plugin from jquery-ui, you’ll need to add wp_enqueue_script( 'jquery-ui-datepicker', false, array(), null, true); that to the theme’s functions.

    You also need to save the settings once to initialize all of the required values.

    Line 27 of the plugin needs to be changed to $plugin_url=plugins_url().'/simple-calendar-picker'; to make the CSS import successfully.

    In order to output the date to the input field, the jQuery commands at line 133 need to be changed to look like this:

    jQuery(document).ready(function() {
     jQuery('.calendarpicker').datepicker({
    				dateFormat: '<?php echo $date_format;?>',
    				changeYear: <?php echo $change_year;?>,
    				changeMonth: <?php echo $change_month;?>,
    				maxDate:'<?php echo $maxdate?>',
            			onSelect: function(date, inst){
            		    		jQuery('.calendarpicker').val(date);
    	        		}
    	});
    });

    https://wordpress.org/plugins/simple-calendar-picker/

  • The topic ‘Fixing the Plugin’ is closed to new replies.