Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 1 replies (of 1 total)

  • robertFudge
    Participant

    @robertfudge

    Hi Mike,

    I don’t think that you can entirely remove the xProfile name field from BuddyPress (Even with the plugin that is available). So I decided why fight it? I cloned the WP username. The only potential problem with this is that the WP username is public – I used a plugin to force stronger WP username and passwords to help with this.

    Here is the base of what I did:

    – On the registration form hide the xProfile name field (CSS display: none) and make a javascript listener (CHANGE) function to change the xProfile name field to the value of the WP username. This will take care of the form validation – xProfile name field is required. See reference…

    – For the edit your profile section I hide the xProfile name field, I also included a PHP function that made the value of this equal to the WP username, in the state that a user was added from the dashboard. (I did not provide PHP, I essentially grabbed WP logged in username…) – You can also display the xProfile name field input as readonly (add attribute: readonly).

    Now all xProfile name field instances in BP are the same as the WP user.

    Reference:
    jQuery(‘input#signup_username’).change(function () {
    jQuery(‘input#field_1’).val(jQuery(this).val());
    });

Viewing 1 replies (of 1 total)
Skip to toolbar