1. Home
  2. API
  3. Function Reference
  4. 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

Updated on August 14, 2020

Was this article helpful?

Related Articles

Not the solution you were looking for?
Click the link below to submit a support ticket
Submit Ticket