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

Function Reference: wlmapi_the_levels

Retrieves a list of all membership levels passed through the filter wlmapi the levels If no filter is applied this function will return the unfiltered array ie the same output as wlmapi get levels

Parameters

This function accepts no parameters

Return

Returns a string containing the filtered list

Example Code

<php
     On the page displaying the levels
     $levels = wlmapi the levels
     echo $levels

     In theme functions file or plugin
     function filter levels$levels 
          Navigate down to the levels array
          $levels array = $levelslevelslevel

          Start output
          $output = <ul>

         Loop through levels to get level name
         foreach  $levels array as $level  
              $output = <li>  $levelname  <li>
         

         End output
         $output = <li>

         return $output


     add filterwlmapi the levels filter levels
>

Example Output

  • Test Level 1
  • Test Level 2
  • Test Level 3

Notes

This functions returns WLMAPIMethodsthe levels in coreapi helperclass api methodsphp

Was this article helpful?

Related Articles

Need Support?

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