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

Function Reference: wlmapi_get_member_levels

Retrieves the membership levels that the specified user belongs to.

Parameters

  • member_id (int) – The ID of the member

Return

Returns a multi-dimensional array containing data for the levels that the  specified member belongs to.

Example Code

<?php
     $levels = wlmapi_get_member_levels(1);
     print_r($levels);
?>

Example Output

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
        )

)

Notes

This functions returns WLMAPIMethods::get_member_levels($member_id) 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