Support » Plugin: WP-Members Membership Plugin » Display name on registration page

  • Resolved filout

    (@filout)


    Hi,

    i create an own (text) field for display name but why is this field shown on the registration page too?
    If i look in the source code, i can read:

    if ( ( 'edit' == $tag ) && ( '' == $wpmem->regchk ) ) {
        switch ( $meta_key ) {
    (...)
            case 'display_name':
                $val = sanitize_text_field( $userdata->display_name );
                break; 
    (...)

    So i would say that this field is only displayed if the profile ist edit by logged in user, because only then $tag is edit. Otherwise $tag ist new.

    Regards, Thomas

Viewing 1 replies (of 1 total)
  • Plugin Author Chad Butler

    (@cbutlerjr)

    Here’s what’s going on there: That particular code determines where the value to display comes from, not whether the field itself is displayed or not. If the form is the profile form (‘edit’) and it is not in an error state ( ” == $wpmem->regchk ), then the field’s value comes from what is stored in WP’s user object.

    If you want to prevent the field from displaying when the registration form is displayed, you can remove it with the wpmem_fields filter. See the filter documentation for examples:
    https://rocketgeek.com/plugins/wp-members/docs/filter-hooks/wpmem_fields/

Viewing 1 replies (of 1 total)
  • The topic ‘Display name on registration page’ is closed to new replies.