Answers for "membership_registration: city or town"

PHP
0

membership_registration: city or town

add_filter( 'wcfm_membership_registration_fields_address', function( $address_fields ) {
	if( isset( $address_fields['city'] ) ) { 
	  $address_fields['city']['custom_attributes'] = array( 'required' => 1 );
	}
	$address_fields = wcfm_hide_field( 'addr_1', $address_fields );
	$address_fields = wcfm_hide_field( 'addr_2', $address_fields );
	$address_fields = wcfm_hide_field( 'state', $address_fields );
	$address_fields = wcfm_hide_field( 'zip', $address_fields );
	$address_fields = wcfm_hide_field( 'country', $address_fields );
	return $address_fields;
}, 50 );
Posted by: Guest on October-29-2021

Browse Popular Code Answers by Language