Displaying a calendar day selector using the Datepicker plugin
As you develop configuration interfaces for your plugins or meta boxes to associate data to custom post types, you may need users to enter dates in text fields. Instead of only relying on the user to correctly enter date information using simple text, a much more reliable data entry method is to use a pop-up calendar. This type of tool allows users to navigate through visual representations of each month and pick the desired date.
Getting ready
You should have access to a WordPress development environment.
How to do it...
Follow these steps to use the jQuery Datepicker script that is provided by default with WordPress to display a pop-up calendar to provide an easy way to select dates:
- Navigate to the WordPress
plugins
directory of your development installation. - Create a new directory called
ch9-calendar-picker
along with a subdirectory calledcss
. - Visit https://www.jqueryui.com/download and...