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

Function Reference: wlmapi_get_level_posts

Retrieves all posts associated with the specified level.

Parameters

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

Return

Returns a multi-dimensional array containing data for each post.

Example Code

<?php
     $posts = wlmapi_get_level_posts(1340726008);
     print_r($posts);
?>

Example Output

Array
(
    [success] => 1
    [posts] => Array
        (
            [post] => Array
                (
                    [0] => Array
                        (
                            [ID] => 1
                            [name] => Hello world!
                            [_more_] => /levels/1340726008/posts/1
                        )

                    [1] => Array
                        (
                            [ID] => 96
                            [name] => Auto Reg
                            [_more_] => /levels/1340726008/posts/96
                        )

                )

        )

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

)

Notes

This functions returns WLMAPIMethods::get_level_posts($level_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