WordPress.org

Ready to get started?Download WordPress

Forums

WP-Members
Spaces in usernames breaking buddypress (2 posts)

  1. NickMackz
    Member
    Posted 1 year ago #

    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?

    http://wordpress.org/extend/plugins/wp-members/

  2. Chad Butler
    Member
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic