I'm having some trouble trying to make an area on my WordPress site, that must be accessible only to members of my Google Group. I tried to make it with some plugin, but most of them would take me to have to ask the users to register themselves in the website, and that would not include a validator to see if he is a member of the Google group.
So, my point is: Is there any way to make a area of my website themselves accessible only by members of a Google Group? If so, how could I do that?
I'm having some trouble trying to make an area on my WordPress site, that must be accessible only to members of my Google Group. I tried to make it with some plugin, but most of them would take me to have to ask the users to register themselves in the website, and that would not include a validator to see if he is a member of the Google group.
So, my point is: Is there any way to make a area of my website themselves accessible only by members of a Google Group? If so, how could I do that?
Share Improve this question edited Jun 16, 2016 at 16:35 Pat J 12.5k2 gold badges29 silver badges36 bronze badges asked Jun 16, 2016 at 15:40 Pedro Luiz SantosPedro Luiz Santos 134 bronze badges1 Answer
Reset to default 0Most of your question is off topic, I guess, because it involves a question about Google's APIs. You would need three things:
- Create the possibility to login to your site with a Google account. There are plugins that make this possible, like this one.
- Import the list of group members from Google. There probably is an API for this, but that is out of the scope of this site. Once you have an array of users an mailaddresses, you can use
wp_create_user
to make new entries in your user table. You would have to set a transient for this, to prevent looking for new group members at Google with every pageload. Also, you should create a special user role for group members. - Finally, in your templates you can add a check for users that are logged in with that special role to display exclusive information.