latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

PHP Get role array

Home Forums Community Forum PHP Get role array

This topic contains 5 replies, has 2 voices. Last updated by  Cristián Lávaque 3 years, 5 months ago.

Topic Author Topic
Posted: Sunday Jul 14th, 2013 at 7:22 pm #53446

I am making an admin page that will set some custom fields to each role level (s2member_level1) etc. But i need to get the name that is stored for each level.

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Tuesday Jul 16th, 2013 at 6:36 am #53497

You mean the roles for the s2Member Levels? they’re just [hilite mono]s2member_leveln[/hilite], where n is the number: [hilite mono]s2member_level1[/hilite], [hilite mono]s2member_level2[/hilite], and so on.

By the way, these are related to what you’re doing:
Knowledge Base » Changing Roles/Capabilities via PHP
Knowledge Base » Locking s2Member Roles/Capabilities

Posted: Tuesday Jul 16th, 2013 at 7:12 pm #53534

Thank for the reply,

I need the name assigned to the roles (I.E. Bronze member etc)

I am setting up an options page for a client and each role has individual options which i am saving as (update_option) in wordpress.

Right now the only way i can link a members level to a title is as you say ‘S2memberlevel1’ whereas i need it to list Bronze Member

Posted: Tuesday Jul 16th, 2013 at 9:19 pm #53541

You can use the [hilite mono]S2MEMBER_LEVELn_LABEL[/hilite] constant, where n is the level number. See: [hilite path]Dashboard -› s2Member® -› API / Scripting -› PHP/API Constants -> S2MEMBER_LEVELn_LABEL[/hilite]

Posted: Tuesday Jul 16th, 2013 at 9:43 pm #53543

Perfect! Thanks very much

Posted: Tuesday Jul 16th, 2013 at 9:51 pm #53545

No problem. :)

Viewing 5 replies - 1 through 5 (of 5 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.