1. Home
  2. Knowledge Base
  3. API
  4. Function Reference
  5. Function Reference: wlmapi_get_member_by

Function Reference: wlmapi_get_member_by

Retrieves all information about the specified member by a specified field (name, login).

Parameters

  • field (string) – Data type to retrieve member by (user_email or user_login)
  • value (string) – Value of specified data type (e.g. email@domain.com)

Return

Returns a multi-dimensional array containing data for the specified member.

Example Code

<?php
     $member = wlmapi_get_member_by('user_email', 'email@domain.com');
     print_r($member);
?>

Example Output

Array
(
    [success] => 1
    [member] => Array
        (
            [0] => Array
                (
                    [ID] => 1
                    [UserInfo] => Array
                        (
                            [ID] => 1
                            [caps] => Array
                                (
                                    [SPF Manage Options] => 1
                                    [SPF Manage Forums] => 1
                                    [SPF Manage User Groups] => 1
                                    [SPF Manage Permissions] => 1
                                    [SPF Manage Tags] => 1
                                    [SPF Manage Components] => 1
                                    [SPF Manage Admins] => 1
                                    [SPF Manage Users] => 1
                                    [SPF Manage Profiles] => 1
                                    [SPF Manage Toolbox] => 1
                                    [SPF Manage Configuration] => 1
                                    [gform_full_access] => 1
                                    [SPF Manage Themes] => 1
                                    [SPF Manage Plugins] => 1
                                    [administrator] => 1
                                )

                            [cap_key] => wp_capabilities
                            [roles] => Array
                                (
                                    [14] => administrator
                                )

                            [allcaps] => Array
                                (
                                    [switch_themes] => 1
                                    [edit_themes] => 1
                                    [activate_plugins] => 1
                                    [edit_plugins] => 1
                                    [edit_users] => 1
                                    [edit_files] => 1
                                    [manage_options] => 1
                                    [moderate_comments] => 1
                                    [manage_categories] => 1
                                    [manage_links] => 1
                                    [upload_files] => 1
                                    [import] => 1
                                    [unfiltered_html] => 1
                                    [edit_posts] => 1
                                    [edit_others_posts] => 1
                                    [edit_published_posts] => 1
                                    [publish_posts] => 1
                                    [edit_pages] => 1
                                    [read] => 1
                                    [level_10] => 1
                                    [level_9] => 1
                                    [level_8] => 1
                                    [level_7] => 1
                                    [level_6] => 1
                                    [level_5] => 1
                                    [level_4] => 1
                                    [level_3] => 1
                                    [level_2] => 1
                                    [level_1] => 1
                                    [level_0] => 1
                                    [edit_others_pages] => 1
                                    [edit_published_pages] => 1
                                    [publish_pages] => 1
                                    [delete_pages] => 1
                                    [delete_others_pages] => 1
                                    [delete_published_pages] => 1
                                    [delete_posts] => 1
                                    [delete_others_posts] => 1
                                    [delete_published_posts] => 1
                                    [delete_private_posts] => 1
                                    [edit_private_posts] => 1
                                    [read_private_posts] => 1
                                    [delete_private_pages] => 1
                                    [edit_private_pages] => 1
                                    [read_private_pages] => 1
                                    [delete_users] => 1
                                    [create_users] => 1
                                    [unfiltered_upload] => 1
                                    [edit_dashboard] => 1
                                    [update_plugins] => 1
                                    [delete_plugins] => 1
                                    [install_plugins] => 1
                                    [update_themes] => 1
                                    [install_themes] => 1
                                    [update_core] => 1
                                    [list_users] => 1
                                    [remove_users] => 1
                                    [add_users] => 1
                                    [promote_users] => 1
                                    [edit_theme_options] => 1
                                    [delete_themes] => 1
                                    [export] => 1
                                    [SPF Manage Options] => 1
                                    [SPF Manage Forums] => 1
                                    [SPF Manage User Groups] => 1
                                    [SPF Manage Permissions] => 1
                                    [SPF Manage Tags] => 1
                                    [SPF Manage Components] => 1
                                    [SPF Manage Admins] => 1
                                    [SPF Manage Users] => 1
                                    [SPF Manage Profiles] => 1
                                    [SPF Manage Toolbox] => 1
                                    [SPF Manage Configuration] => 1
                                    [gform_full_access] => 1
                                    [SPF Manage Themes] => 1
                                    [SPF Manage Plugins] => 1
                                    [administrator] => 1
                                )

                            [filter] => 
                            [user_login] => username
                            [user_nicename] => username
                            [user_email] => email@domain.com
                            [user_url] => 
                            [user_registered] => 2012-06-18 20:00:43
                            [user_activation_key] => 
                            [user_status] => 0
                            [display_name] => John Morris
                            [custom_] => 
                            [custom_0] => 
                            [custom_john_test] => 
                            [wpm_login_date] => 1355154059
                            [wpm_login_ip] => 127.0.0.1
                            [wpm_login_limit] => 
                            [wpm_useraddress] => Array
                                (
                                    [company] => 
                                    [address1] => 
                                    [address2] => 
                                    [city] => 
                                    [state] => 
                                    [zip] => 
                                    [country] => Select Country
                                )

                        )

                    [Sequential] => 
                    [Levels] => Array
                        (
                            [1340726008] => stdClass Object
                                (
                                    [Level_ID] => 1340726008
                                    [Name] => Test Level 1
                                    [Cancelled] => 
                                    [CancelDate] => 
                                    [Pending] => 
                                    [UnConfirmed] => 
                                    [Expired] => 
                                    [ExpiryDate] => 
                                    [Active] => 1
                                    [Status] => Array
                                        (
                                            [0] => Active
                                        )

                                    [Timestamp] => 1354299649
                                    [TxnID] => WL-1-1340726008
                                )

                            [1340896239] => stdClass Object
                                (
                                    [Level_ID] => 1340896239
                                    [Name] => Test Level 2
                                    [Cancelled] => 
                                    [CancelDate] => 
                                    [Pending] => 
                                    [UnConfirmed] => 
                                    [Expired] => 
                                    [ExpiryDate] => 
                                    [Active] => 1
                                    [Status] => Array
                                        (
                                            [0] => Active
                                        )

                                    [Timestamp] => 1354299023
                                    [TxnID] => WL-1-1340896239
                                )

                        )

                )

        )

    [supported_verbs] => Array
        (
            [0] => GET
            [1] => PUT
            [2] => DELETE
        )

)

Notes

This functions returns WLMAPIMethods::get_member_by($field, $value) in core/api-helper/class-api-methods.php

Was this article helpful?

Related Articles

Need Support?

Can't find the answer you're looking for?
Contact Support