• Resolved grayzee

    (@grayzee)


    Hello,

    Can you please help me update the username input field placeholder text to say

    “Username or Email address”

    I read that you said you can use the uwp_form_input_text_username filter but im not sure how to change it using the above? Can you please provide some more information.

    Many thanks,
    Graeme

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    Try using following code in functions.php file of the currently active theme or via Code Snippets plugin and let me know if it helps:

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

    Regards,
    Patrik

    Thread Starter grayzee

    (@grayzee)

    Works perfectly! thanks for this.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘update username placeholder text’ is closed to new replies.