Require the Last Name at EDD Checkout
Makes the last name field required on the Easy Digital Downloads checkout, for invoices and licences that need a full name.
Opens WPIDE on
Code
add_filter( 'edd_purchase_form_required_fields', function ( $fields ) {
$fields['edd_last'] = array(
'error_id' => 'invalid_last_name',
'error_message' => 'Please enter your last name.',
);
return $fields;
} );
Notes
The field is already on the form; this only makes it mandatory.
How to add this snippet
- Install WPIDE on your WordPress site (it is free) and open Code Snippets.
- Use snippet above adds it from the library in one click. Or copy the code into a new snippet with the same code type.
- It is added inactive: review the code and settings, then switch it on.