Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save plugin-republic/80d82903168b909d164b2fcc338e4ec9 to your computer and use it in GitHub Desktop.
Save plugin-republic/80d82903168b909d164b2fcc338e4ec9 to your computer and use it in GitHub Desktop.
Add select fields for month and year to date field
<?php
/**
* Add select fields for month and year to date field
*/
function prefix_date_field_params_change_month( $params, $item ) {
$params[] = "changeMonth: true";
$params[] = "changeYear: true";
$params[] = "yearRange: '1900:2030'";
return $params;
}
add_filter( 'pewc_filter_date_field_params', 'prefix_date_field_params_change_month', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment