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

Function Reference: wlmapi_the_level_posts

Retrieves all posts of the specified level passed through the filter: wlmapi_the_level_posts. If no filter is applied, this function will return the unfiltered array, i.e. the same output as wlmapi_get_level_posts.


  • level_id (int) – The ID of the level to retrieve posts from


Returns a string containing the filtered list.

Example Code

     //On the page displaying the list
     $posts = wlmapi_the_level_posts(1340726008);

     //Inside the theme functions file or a plugin
     function filter_posts($posts) {
          //Navigate down to the posts array
          $posts_array = $posts['posts']['post'];

          //Loop through posts array
          foreach ( $posts_array as $post ) {
               $output .= '<ul>';
               $output .= '<li>' . $post['ID'] . '</li>';
               $output .= '<li>' . $post['name'] . '</li>';
               $output .= '</ul>';

          return $output;

     add_filter('wlmapi_the_level_posts', 'filter_posts');

Example Output

  • 1
  • Hello world!
  • 96
  • Auto Reg


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