/** * Removes the username field from the * WP-Members registration form using * the `wpmem_fields` filter. */ add_filter( 'wpmem_fields', function( $fields, $tag ) { if ( 'register' == $tag ) { unset( $fields['username'] ); } return $fields; }, 10, 2 ); /** * Inserts a filler value for the username * field using the user's email address so * that the user can be inserted. * * Uses the `wpmem_pre_validate_form` filter * and `wpmem_create_username_from_email() */ add_filter( 'wpmem_pre_validate_form', function( $post_data, $tag ) { if ( 'register' == $tag ) { $post_data['username'] = wpmem_create_username_from_email( $post_data['user_email'] ); } return $post_data; }, 10, 2 ); /** * This filters the text for the main body * login form and the widget to only display * "Email" instead of "Username or email". */ add_filter( 'wpmem_default_text', function( $text ) { $text['login_username'] = 'Email'; $text['widget_login_username'] = 'Email'; return $text; });
Not sure what to do with this code?
You're not a "coder" and don't know what to do? Don't worry! Code Snippets are the basic building blocks of WordPress customization, and once you know the basics, they are simple to use.
Here are some free articles to get you started:
- Using Code Snippets from the Site
- Using a code snippets plugin
- The functions.php File
- Create a plugin file for custom functions
- Create a child theme
- Do not modify plugin files!
For "hands on" help, consider a plugin support subscription or the Pro Bundle.