Create users via PHP
I found out the problem. i used wp_update_user to create the user, instead of wp_create_user. my bad :/
I found out the problem. i used wp_update_user to create the user, instead of wp_create_user. my bad :/
Yes, you can. However, you’ll need to know either the userid or the username. Create a link with any of that as a data attribute and make a ajax call with that. On success, you can just reload the page and your user will be logged in. If you know the user id.. function wpse_304392_login_by_id() … Read more
Don’t write your own bootstrapper, use Ajax hooks via wp-admin/admin-ajax.php Documentation: https://codex.wordpress.org/AJAX_in_Plugins Then you can be sure WordPress has included all the functions you need. Update: I missed the bit about posting from local machine to remote server. If your JavaScript is running on another domain, it won’t be sending back your web server’s login … Read more
Please update the code as below add_action( ‘admin_menu’, ‘remove_menus’ ); function remove_menus(){ $user = wp_get_current_user(); $role = ( array ) $user->roles; if($role[0]==subscriber) add_menu_page( ‘edit.php’ ); //dashboard }
I suggest using BuddyPress user profiles feature, you don’t need to enable all BuddyPress features. Gravity Forms can be used to create profile-like fields, but it is not really tied to real WordPress user profiles: https://www.gravityforms.com/creating-team-member-profiles/
If you want them to be able to choose the type You’ll need to write your own registration logic After that check via get_user_meta() to see if they have a certain permission if they can do xyz and allow accordingly. I’ve done custom user types before for a plugin i wrote. There’s no build in … Read more
Not sure if this is want you are looking for, but one approach could be hiding the registration altogether for all user, but the users from countries and territories you need. Here is a plugin I’ve been checking out myself, but I must admit, I haven’t used it on a production site yet. It looks … Read more
I’ve seen Role Manager used to restrict editor access only to pages on which they have been designated as authors. Would guess it would work with custom post types.
You can do that hooking into wpmu_new_blog and then creating the user if it does not exists, and adding that user to the blog being created. To do so, you will use a code like this ( only for 1 user) , as a network enabled plugin or on the main theme functions.php add_filter(‘wpmu_new_blog’,’wpse_29543_new_blog’); function … Read more
Try out http://www.cozmoslabs.com/wordpress-profile-builder/ . It has front-end user registration with avatars uploads and user listing. The one thing that it doesn’t have is approve user before activating them on the site, but you can delete and edit users from the backend in the users section.