Support » Plugin: WP-Members: Membership Framework » [Plugin: WP-Members] Spaces in usernames breaking buddypress

  • NickMackz


    I am using wp-members with BuddyPress but have not integrated the profile fields with the wp-members form (not sure if this is possible anyway). The problem is that wp-members allows users to put spaces in their usernames on registration. This causes problems with BuddyPress which isn’t designed to handle spaces. For example, it is impossible to send a PM to someone with a space or spaces in their username.

    Would it possible to add an option in the admin to block people from registering with spaces in their usernames?

    Unrelated, but is it possible to integrate BuddyPress profile fields with the registration form?

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


    WP-Members validates the username using the WP function validate_username. If you need to do additional validation on this (or any other) registration field, you can do it with the wpmem_pre_register_data action hook, which comes after WP-Members has done all of its validation, but before the user is inserted.

    If your validation results in an error, globalize $wpmem_themsg and put your error message text in that variable. Following this hook, the plugin checks for $wpmem_themsg to have a value and if it does, an error exists, stopping registration and displaying the validation error to the user.

    Information on the wpmem_pre_register_data hook (and others) is available here.

    On your unrelated question, yes, as long as you create fields in WP-Members that have Option Names (user meta) that match the BuddyPress fields, you should be fine.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WP-Members] Spaces in usernames breaking buddypress’ is closed to new replies.