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

Function Reference: wlmapi_get_levels

Retrieves all membership levels associated with a WishList Member install.

Parameters

This function accepts no parameters.

Return

Returns a multi-dimensional array containing data for each membership level.

Example Code

<?php
     $levels = wlmapi_get_levels();
     print_r($levels);
?>

Example Output

Array
(
    [success] => 1
    [levels] => Array
        (
            [level] => Array
                (
                    [0] => Array
                        (
                            [id] => 1340726008
                            [name] => Test Level 1
                            [_more_] => /levels/1340726008
                        )

                    [1] => Array
                        (
                            [id] => 1340896239
                            [name] => Test Level 2
                            [_more_] => /levels/1340896239
                        )

                    [2] => Array
                        (
                            [id] => 1340896250
                            [name] => Test Level 3
                            [_more_] => /levels/1340896250
                        )

                )

        )

    [supported_verbs] => Array
        (
            [0] => GET
            [1] => POST
        )

)

Notes

This functions returns WLMAPIMethods::get_levels() 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