Skip to content

Instantly share code, notes, and snippets.

@michaeldoye
Created June 26, 2015 21:32
Show Gist options
  • Save michaeldoye/f34c00f0f157490d5afb to your computer and use it in GitHub Desktop.
Save michaeldoye/f34c00f0f157490d5afb to your computer and use it in GitHub Desktop.
Add custom field to edit address page
// add fields to edit address page
function woo_add_edit_address_fields( $fields ) {
$new_fields = array(
'date_of_birth' => array(
'label' => __( 'Date of birth', 'woocommerce' ),
'required' => false,
'class' => array( 'form-row' ),
),
);
$fields = array_merge( $fields, $new_fields );
return $fields;
}
add_filter( 'woocommerce_default_address_fields', 'woo_add_edit_address_fields' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment