Website visible only to Registered users (non wp-admin)
In short, the $post global isn’t setup at the wp_loaded state. See: When and Where is global $post Set and Available? for detailed information. So use another hook, like template_redirect.
In short, the $post global isn’t setup at the wp_loaded state. See: When and Where is global $post Set and Available? for detailed information. So use another hook, like template_redirect.
WordPress provides the is_user_logged_in() function for this. Documentation: https://codex.wordpress.org/Function_Reference/is_user_logged_in You could do something like: <?php if ( is_user_logged_in() ) { // show button to Test_Page } else { // show button to registration page } ?>
Even if you disable registration, if the server has WP-CLI installed and if someone has ssh access then an admin user can easily be created using following command: wp user create bob [email protected] –role=administrator Thus, that admin user can login and remove other user account easily. Check this to know about all the possibilities through … Read more
As you assumed – the solution is pretty easy. First create a file(for instance) skip-email-check.php and inside it put the code from the other answer: add_filter(‘wpmu_validate_user_signup’, ‘skip_email_exist’); function skip_email_exist($result){ if(isset($result[‘errors’]->errors[‘user_email’]) && ($key = array_search(__(‘Sorry, that email address is already used!’), $result[‘errors’]->errors[‘user_email’])) !== false) { unset($result[‘errors’]->errors[‘user_email’][$key]); if (empty($result[‘errors’]->errors[‘user_email’])) unset($result[‘errors’]->errors[‘user_email’]); } define( ‘WP_IMPORTING’, ‘SKIP_EMAIL_EXIST’ ); return $result; … Read more
For Fb Login/Registration, Read The Article link Given here
You may try a very different approach which I just used recently. Try out the WordPress plugin Pie Register for that, it gives you an easy drag-and-drop interface for customising your registration form, adding custom fields of all sorts and the e-mails being sent and who is being activated. Hope this is what you need!
Find by myself. Just forget to declare $user = wp_get_current_user();
To achieve this, create a new page template and use this code in that file. Then, use your submit form to redirect the user after commenting to the new page. $user_login = $_POST[‘user_login’]; $user_email = $_POST[‘user_email’]; $errors = register_new_user($user_login, $user_email); if ( !is_wp_error($errors) ) { $redirect_to = !empty( $_POST[‘redirect_to’] ) ? $_POST[‘redirect_to’] : ‘wp-login.php?checkemail=registered’; wp_safe_redirect( … Read more
you can use this add_action(‘after_setup_theme’, ‘remove_admin_bar’); function remove_admin_bar() { if (!current_user_can(‘administrator’) && !is_admin()) { show_admin_bar(false); } }
you can use Cimy User Extra Fields , its a plugin that lets you add extra user fields to the registration form. or you can create your own custom registration page with your extra fields by following this great article http://www.cozmoslabs.com/2010/05/31/wordpress-user-registration-template-and-custom-user-profile-fields/