Retrieves all members of the specified level passed through the filter: wlmapi_the_level_members. If no filter is applied, this function will return the unfiltered array, i.e. the same output as wlmapi_get_level_members.
Parameters
- level_id (int) – The ID of the level to retrieve members from
Return
Returns a string containing the filtered list.
Example Code
<?php //On the page displaying the list $members = wlmapi_the_level_members(1340726008); print_r($members); //Inside the theme functions file or a plugin function filter_members($members) { //Navigate down to the members array $members_array = $members['members']['member']; //Loop through members foreach ( $members_array as $member ) { $output .= '<ul>'; $output .= '<li>' . $member['id'] . '</li>'; $output .= '<li>' . $member['user_login'] . '</li>'; $output .= '<li>' . $member['user_email'] . '</li>'; $output .= '</ul>'; } return $output; } add_filter('wlmapi_the_level_members', 'filter_members'); ?>
Example Output
- 11
- wray
- [email protected]
- 12
- stu
- [email protected]
Notes
This functions returns WLMAPIMethods::the_level_members() in core/api-helper/class-api-methods.php