mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-04 12:22:24 +08:00
https://github.com/easydigitaldownloads/library/blob/master/_checkout/required-fields.html
17 lines
553 B
Text
17 lines
553 B
Text
function pw_edd_purchase_form_required_fields( $required_fields ) {
|
|
|
|
// Set a field as required
|
|
$required_fields['edd_last'] = array(
|
|
'error_id' => 'invalid_last_name',
|
|
'error_message' => __( 'Please enter your last name.', 'edd' )
|
|
);
|
|
|
|
/*
|
|
* If you wanted to remove a field from required list
|
|
* you would simply unset the array key
|
|
*/
|
|
// unset( $required_fields['edd_first'] );
|
|
|
|
return $required_fields;
|
|
}
|
|
add_filter( 'edd_purchase_form_required_fields', 'pw_edd_purchase_form_required_fields' );
|