Custom login/registration without plugins
-
hello everyone,
i’ma total noob in developing in wordpress, since it’s very short time since i started messing with it.
what i was looking for was a guide or a tutorial to customize login/registration procedures, since i want to use WP not as just a blog but restrict access to private pages only to registered/logged users.(without letting them having access to the backend)
i have found several guides which lead me at least to have a fully functional registration form and a semi-working login system (even if i had to debug a bit)
i don’t seem to catch the “philosophy” behind the final stages of the login phases:
if( $username == "" || $password == "" ) { $err = 'Please don\'t leave the required field.'; } else { $user_data = array(); $user_data['user_login'] = $username; $user_data['user_password'] = $password; $user_data['remember'] = $remember; $user = wp_signon( $user_data, false ); // <-- HERE if ( is_wp_error($user) ) { $err = $user->get_error_message(); //exit(); <-- MY DEBUG in order to have error system working, otherwise it's skipped } else { wp_set_current_user( $user->ID, $username ); do_action('set_current_user'); //<-- AND HERE [....]
as there are few variants, as per Codex guides mostly similar, but with the same result: i can’t have any auth cookie created, nor can’t find a way to check if the user is logged or not
thank you!
- The topic ‘Custom login/registration without plugins’ is closed to new replies.