This is probably a pretty unusual question but I will explain my problem as best I can. I have a custom plugin which authenticates users from another non-wordpress system and automatically adds users to specific memberships depending on their predefined roles. I am using MS_Model_Relationship::create_ms_relationship() to add users to specific memberships. For the most part I have this plugin working as desired.
The one problem I have is if I have a newly created user which has not yet had any association with Protected Content and I add them to multiple memberships with php through my plugin, then protected content shows that they are in the these groups but content is protected as if they aren't in any groups. But if I then make any change to which groups they are in (Add or remove) then everything starts to work fine and content is protected properly.
So my questions are: Is there some why a user needs to be activated with Protected Content? Is there a function which will allow me to do this in my custom plugin? If not, can you think of anything else that might be causing my problem? Let me know if any further explanation is required.