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.

Match User Label via WHERE

Home Forums Community Forum Match User Label via WHERE

Tagged: ,

This topic contains 2 replies, has 2 voices. Last updated by  Angela Zou 3 years, 10 months ago.

Topic Author Topic
Posted: Monday Feb 18th, 2013 at 10:58 pm #42405
Angela Zou
Username: angelaz

Hi,

I’m using Pods to build a form where one of the field I specify a list of all S2member who I have been given the label of Instructor specifically. However, I noticed that the information is serialized into a string and it looks to me that I have to use regular expressions, which are known for their inefficiency to match these users. Because Pods is limited specifically to the WHERE clause, how can I match these users?

Angela

PS: I know I can do conditional to test for the user level, but is there a built-in function that will return the list of users based on their S2member label/level? Say get_s2member_users?

List Of Topic Replies

Viewing 2 replies - 1 through 2 (of 2 total)
Author Replies
Author Replies
Posted: Tuesday Feb 19th, 2013 at 2:28 am #42442
Staff Member

Thanks for your inquiry. ~ We appreciate your patience :-)

You can use the WordPress® function get_users()

Example code:

<?php
foreach(get_users('role=s2member_level1') as $user)
	echo $user->ID.'<br />';
?>

See also: Knowledge Base » s2Member® Roles/Capabilities
See also: Knowledge Base » Changing Roles/Capabilities via PHP

Posted: Tuesday Feb 19th, 2013 at 3:49 am #42450
Angela Zou
Username: angelaz

Thanks for the super fast reply :)

Viewing 2 replies - 1 through 2 (of 2 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.