33

The process involves 2 steps: show the frontend form save the data on submission There are 3 different approach that comes to my mind to show the frontend: use the built-in registration form, editing styles, etc to make it more "frontend like" use a WordPress page/post, and display form using a shortcode use a dedicate template not connected with any page/...


28

For 2018 and onwards users: Since WordPress 4.9.0 there are new filters you can use for this (no need for a plugin anymore): wp_new_user_notification_email - customise email sent to User wp_new_user_notification_email_admin - customise email sent to Admin Usage example on email sent to Admin (you can paste this in your theme's functions.php ): add_filter(...


28

Well the second bit of code is technically the correct way to do it. However, at the end of the add_settings_field() you can pass arguements. Please view the WordPress Add_Settings_Field function reference. This will help you in getting the best understanding of how the add_settings_field() function really works. Now, with that said, you could use a '...


17

THE ONLY RELIABLE WAY: if( is_wplogin() ){ ... } code: function is_wplogin(){ $ABSPATH_MY = str_replace(array('\\','/'), DIRECTORY_SEPARATOR, ABSPATH); return ((in_array($ABSPATH_MY.'wp-login.php', get_included_files()) || in_array($ABSPATH_MY.'wp-register.php', get_included_files()) ) || (isset($_GLOBALS['pagenow']) && $GLOBALS['...


13

TLDR; Put the following form into your theme, the name and id attributes are important: <form action="<?php echo site_url('wp-login.php?action=register', 'login_post') ?>" method="post"> <input type="text" name="user_login" value="Username" id="user_login" class="input" /> <input type="text" name="user_email" value="E-Mail" id="...


11

You kind of answered the question yourself already, Create a function that will create the 3 posts ex: function create_new_user_posts($user_id){ if (!$user_id>0) return; //here we know the user has been created so to create //3 posts we call wp_insert_post 3 times. // Create post object $...


11

Its Not has hard as you think it is :) Add the password fields to your form : password: <input type="password" name="pass1" style="width:250px; margin-bottom:3px;"><br /> repeat password: <input type="password" name="pass2" style="width:250px; margin-bottom:3px;"><br /> then in your if($_POST){ replace this line: $random_password ...


9

There is an more sophisticated solution instead of htaccess or plugin. For those interested in this topic, there's my code to redirect after (exactly before) unsuccessfull resitration attempt. Why before? Before an attempt for registration, WordPress checks for an username and email address, whether they are not empty, whether they are not already in DB, ...


9

You can check it very easily with the help of get_option. Here is a simple code for checking if user registration is allowed. if ( get_option( 'users_can_register' ) ) { // Your custom code or message to display if user registration is allowed. } get_option( 'users_can_register' ) returns boolean true (1) or false (0).


9

You can try to modify it with the comment_form_defaults filter: /** * Modify the "must_log_in" string of the comment form. * * @see http://wordpress.stackexchange.com/a/170492/26350 */ add_filter( 'comment_form_defaults', function( $fields ) { $fields['must_log_in'] = sprintf( __( '<p class="must-log-in"> You must <...


9

You can intercept this email before it is sent using the phpmailer_init hook. By default, this hook fires before any email is sent. In the function below, $phpmailer will be an instance of PHPMailer, and you can use its methods to remove the default recipient and manipulate the email before it is sent. add_action('phpmailer_init', '...


9

After much research, I finally turned to examining the WordPress core file wp_login.php hoping that WP would show how they do it in a non-obtuse manner. From the information around line 331 (WP 4.6.1), I put together the following code. <?php global $gw_activate_template; extract( $gw_activate_template->result ); $url = is_multisite() ? ...


8

The Starkers theme setup is hooked to after_setup_theme, at a priority of 10. So you basically have to wrap the unregister function inside another function (child themes functions.php file) and add it later than the parent themes setup function, so it gets first added by the parent and later on removed by the child. function ...


7

When a POST is set to private, non-logged in users will receive a 404 message. If you dump the global variable $wp_query, var_dump($wp_query); ..you will notice that no post_status is present in the parameters returned therefore using the slug (or name parameter of query_vars array for example) we can get the post status of the POST that is trying to be ...


7

Since version 3.4 (or earlier?) WordPress sends a special HTTP header (not in HTML) on login and admin pages: X-Frame-Options: SAMEORIGIN So your browser will show you some text built into the browser, not sent from WordPress. From wp-includes/default-filters.php: add_action( 'login_init', 'send_frame_options_header', 10, 0 ); add_action( 'admin_init', '...


7

There are two very different hooks you can use, depending on the installation: wpmu_validate_user_signup for multi-site and registration_errors for single-site. The following untested code shows how to use them. You can tweak the array in user_name_is_forbidden() to your needs. Use regular expressions for the matches. // multi-site add_filter( '...


6

There is a plugin for this. It is Network Username Restrictions Override. Please remember to check out the FAQ #2 to know how to allow periods in usernames. Let me quote it here... You'll have to update the regular expressions in your .htaccess file if you use email addresses or periods in site URLs. The default WordPress .htaccess configuration does ...


6

Actually I found this to be more strait forward and simpler: //add columns to User panel list page function add_user_columns($column) { $column['address'] = 'Street Address'; $column['zipcode'] = 'Zip Code'; return $column; } add_filter( 'manage_users_columns', 'add_user_columns' ); //add the data function add_user_column_data( $val, $...


5

You can use this: wp_new_user_notification( $user_id, $random_password);


5

Hook into login_form_register and throw people to your registration page with wp_redirect. <?php add_action( 'login_form_register', 'wpse45134_catch_register' ); /** * Redirects visitors to `wp-login.php?action=register` to * `site.com/register` */ function wpse45134_catch_register() { wp_redirect( home_url( '/register' ) ); exit(); // always ...


5

You should hook into the user_register action. I did something similar on a recent site (not involving having to fill out profile fields, but involving having to renew a membership). I will propose a multi-part solution (let me know if any of it is confusing, it's been a long day and I might not explain it perfectly). EDIT: Upon thinking about it further, ...


5

Please take a look at user_register hook This is fired when a new user is registered and conveniently passes you the user ID of the new user. function function_name( $user_id ) { /* do what you want to do with ID here */ } add_action( 'user_register', 'function_name');


5

Another simple way to do this without needing to add another script is using PHP's str_replace function. $args = array( 'echo' => false, ); $form = wp_login_form( $args ); //add the placeholders $form = str_replace('name="log"', 'name="log" placeholder="Username"', $form); $form = str_replace('name="pwd"', 'name="pwd" placeholder="Password"', $...


5

Using the [woocommerce_my_account] shortcode, a user will see their account details if they're logged in and if they're not logged in, they'll see a login and registration form. Using the same page title "My Account" for these different users isn't ideal because a user that has never created an account won't naturally navigate to a "My Account" page in ...


5

This message is not part of the WordPress core. I confirmed this suspicion by searching for the message within the WordPress core files. When it was not found, I then searched the message using a search engine. It appears that you are using the New User Approve Message plugin. This message is defined in new-user-approve/includes/messages.php#L33 /** * The ...


4

Using Wordpress 4.7.2, I solved this with the following hooks: // This will suppress empty email errors when submitting the user form add_action('user_profile_update_errors', 'my_user_profile_update_errors', 10, 3 ); function my_user_profile_update_errors($errors, $update, $user) { $errors->remove('empty_email'); } // This will remove javascript ...


4

This is a pretty old question, but is still relevant. Anyway, @Milo definitely had the right idea. Here is what I use and it works great. This is very convenient when you want to create users, but prefer to keep your wordpress backend on lockdown. For example if you have a blog and prefer your content authors submit their work to you, this enables you ...


4

I made a website some time ago that was displaying a customized registration form on the front end side. This website is not live anymore but here are some screenshots. Here are the steps I have followed: 1) Activate the possibility for all visitors to request a new account via Settings > General > Membership option. The registration page now appears at ...


4

Okay, this looks tricky, but I think it's possible. The user-new.php file calls wp_dropdown_roles() to output the list of roles. The wp_dropdown_roles() function calls get_editable_roles() to get the list of roles to output. The get_editable_roles() function has a filter, editable_roles. So, you should be able to add a filter for editable_roles, such that, ...


4

Let's follow the white rabbit. http://core.trac.wordpress.org/browser/tags/3.3.1/wp-login.php#L414 ...can't be changed, it's hardcoded. However it leads to here when clicked: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-login.php#L481 ...which has a wp_signup_location filter for multisite, which in case your site !is_multisite() will never fire ...


Only top voted, non community-wiki answers of a minimum length are eligible