name = 'date_picker'; $this->label = __("Date Picker",'acf'); $this->category = __("jQuery",'acf'); $this->defaults = array( 'date_format' => 'yymmdd', 'display_format' => 'dd/mm/yy', 'first_day' => 1, // monday ); // actions add_action('init', array($this, 'init')); // do not delete! parent::__construct(); } /* * init * * This function is run on the 'init' action to set the field's $l10n data. Before the init action, * access to the $wp_locale variable is not possible. * * @type action (init) * @date 3/09/13 * * @param N/A * @return N/A */ function init() { global $wp_locale; $this->l10n = array( 'closeText' => __( 'Done', 'acf' ), 'currentText' => __( 'Today', 'acf' ), 'monthNames' => array_values( $wp_locale->month ), 'monthNamesShort' => array_values( $wp_locale->month_abbrev ), 'monthStatus' => __( 'Show a different month', 'acf' ), 'dayNames' => array_values( $wp_locale->weekday ), 'dayNamesShort' => array_values( $wp_locale->weekday_abbrev ), 'dayNamesMin' => array_values( $wp_locale->weekday_initial ), 'isRTL' => isset($wp_locale->is_rtl) ? $wp_locale->is_rtl : false, ); } /* * create_field() * * Create the HTML interface for your field * * @param $field - an array holding all the field's data * * @type action * @since 3.6 * @date 23/01/13 */ function create_field( $field ) { // make sure it's not blank if( !$field['date_format'] ) { $field['date_format'] = 'yymmdd'; } if( !$field['display_format'] ) { $field['display_format'] = 'dd/mm/yy'; } // html echo '