Integrating Facebook Registration (and Login) on a WordPress page
For Fb Login/Registration, Read The Article link Given here
For Fb Login/Registration, Read The Article link Given here
I think each user can only have one role. However this is how its possible to change role, if for some reason that I dont know the user can have more than one role, remove the remove role line. you can check the available roles here. $current_user = wp_get_current_user(); // Remove role $current_user->remove_role( ‘subscriber’ ); … Read more
It was a bug in WordPress. Please see this track ticket #21581 for details.
I found out what was causing this problem. I had a plugin installed called Simple Posts Generator which I used to generate 10 sample posts for testing purposes. Since I generated the articles all at the same time, the post_date value in the database was the same for each post, which confused WordPress as to … Read more
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