First thank you and congratulations for the great Groups plugin!
I have enjoyed using it to protect pages "by hand" for some users through the ultra-simple UI you provide in the WP backend. But I have now to go a step further by doing things programmatically in php templates (at beginner level).
What I was conveniently doing by hand was, for a set of manually create pages :
- define both a capability and a group to protect thes pages and assign them to the pages
- assign users to the group for them (only) being able to read the page
I now have to do the same in php for a set of page created programmatically. I have seen the code snippets you give in your doc to do the second step (assign users to group), no problem. But I am lost in your API for achieving the first step, which I understand is a list of several API calls that I can't figure out.
Would you have some code examples on how to do that, or more precise advices for me to use the API (I'm a php beginner but I can understand things).
Many thanks in advance!