S2Member integration with CPT

Greetings,

We are running the S2Member(Pro) plugin, but I have just taken over and know nothing about it and very little about Wordpress. I have had the good manners to search the S2Member forums however.

The issue is we have a relation that needs to be created between S2Members and another content type.

For example:

  • Members = Doctors
  • Clinics = Custom Post Type with geography, information, taxonomy fields etc.

I want to build a query that uses the 1:many relationship between one clinic and many doctors.

Does S2Member expose any fields that I can hook into? Eg, Can I check who is currently paid up and only display those doctors on a given clinic’s post?

Is there a tutorial or recipe/example for such a solution?

Thanks in advance…

You could query WP for all users with the s2Member level role, or access capability that the doctor would have in your setup.

https://codex.wordpress.org/Function_Reference/get_users
WP Admin > s2Member > API / Scripting > Advanced PHP Conditionals

I hope that helps. :slight_smile: