Mika MAtikainen

Apr 15, 2020 · 4 min read

How to Replace the “Username” Placeholder Text in Form?

add_filter('uwp_get_field_placeholder', 'wpsc_uwp_get_field_placeholder_cb', 10, 2); 
function wpsc_uwp_get_field_placeholder_cb($placeholder, $field){    
	if($field && isset( $field->form_type ) && $field->form_type == 'login' && $field->htmlvar_name == 'username' ){         
		$placeholder = __( "Email", 'userswp' );         
		if ( isset( $field->is_required ) && ! empty( $field->is_required ) ) { 		  
		$placeholder .= ' *'; 	   
		}    
	}      
	return $placeholder; 
} 

Subscribe To Our Newsletter

Join our mailing list to receive the latest news and updates from our team.

You have Successfully Subscribed!

Share This