Tag Archives | posts

Function Reference: wlmapi_unmanage_post

Un-protects posts and removes them from the membership level. Parameters level_id (int) – The ID of the level to remove posts from post_ids (int) – Accepts an array or comma-seprated list of post IDs Return Returns a multi-dimensional array containing operation status for each post. Example Code <?php $posts = wlmapi_unmanage_post(1340726008, ‘1,60,62’); print_r($posts); ?> Example Output Array ( […]

Function Reference: wlmapi_manage_post

Protects posts and adds them to the membership level. Parameters level_id (int) – The ID of the level to add posts to post_ids (int) – Accepts an array or comma-seprated list of post IDs Return Returns a multi-dimensional array containing operation status and an array containing data for all posts that belong to the specified level. Example Code […]

Function Reference: wlmapi_unprotect_post

Un-protects a post. Parameters post_id (int) – The ID of the post to un-protect Return Returns a multi-dimensional array containing operation status. Example Code <?php $posts = wlmapi_unprotect_post(1); print_r($posts); ?> Example Output Array ( [success] => 1 [supported_verbs] => Array ( [0] => DELETE ) ) Notes This functions returns WLMAPIMethods::unprotect_post($args) in core/api-helper/class-api-methods.php

Function Reference: wlmapi_protect_post

Protects a post. Parameters args (array) – An array of accepted arguments specified below: Parameter Description Required Default ContentIds (array) An array of post IDs to protect Required Return Returns a multi-dimensional array containing operation status and an array containing all protected posts. Example Code <?php $args = array( ‘ContentIds’ => array(1,96) ); $posts = wlmapi_protect_post(1340726008, $args); […]

Function Reference: wlmapi_get_protected_posts

Retrieves all posts that have been protected. Parameters There are no parameters for this function Return Returns a multi-dimensional array containing data for each protected post. Example Code <?php $posts = wlmapi_get_protected_posts(); print_r($posts); ?> Example Output Array ( [success] => 1 [posts] => Array ( [post] => Array ( [0] => stdClass Object ( [ID] […]

Function Reference: wlmapi_remove_post_from_level

Removes a membership level’s access to the specified post. Parameters level_id (int) – The ID of the level to remove the post from post_id (int) – The ID of the post to remove access from Return Returns a multi-dimensional array containing operation status. Example Code <?php $posts = wlmapi_remove_post_from_level(1340726008, 1); print_r($posts); ?> Example Output Array ( […]

Function Reference: wlmapi_add_post_to_level

Gives a membership level access to the specified post according to the specified arguments. Parameters level_id (int) – The ID of the level to add posts to args (array) – An array of accepted arguments specified below: Parameter Description Required Default ContentIds (array) An array of post IDs to add to the membership level Required Return Returns a […]

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. Parameters level_id (int) – The ID of the level to retrieve posts from Return Returns a string containing the filtered list. Example Code <?php //On the page […]

Function Reference: wlmapi_get_level_post_type

Retrieves all posts of the specified post type associated with the specified level. Parameters level_id (int) – The ID of the level to retrieve posts from post_type (string) – The slug of the post type to retrieve posts for Return Returns a multi-dimensional array containing data for each post. Example Code <?php $posts = wlmapi_get_level_post_type(1340726008, ‘lesson’); […]

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] => […]