Gives a membership level access to the specified page according to the specified arguments.
Parameters
- level_id (int) – The ID of the level to add pages to
- args (array) – An array of accepted arguments specified below:
Parameter | Description | Required | Default |
---|---|---|---|
ContentIds (array) | An array of page IDs to add to the membership level | Required |
Return
Returns a multi-dimensional array containing operation status and an array containing all the pages that membership level has access to.
Example Code
<?php $args = array( 'ContentIds' => array(145,159) ); $pages = wlmapi_add_page_to_level(1340726008, $args); print_r($pages); ?>
Example Output
Array ( [success] => 1 [pages] => Array ( [page] => Array ( [0] => Array ( [ID] => 159 [name] => News Feed [_more_] => /levels/1340726008/pages/159 ) [1] => Array ( [ID] => 145 [name] => Chat [_more_] => /levels/1340726008/pages/145 ) ) ) [supported_verbs] => Array ( [0] => GET [1] => POST ) )
Notes
This functions returns WLMAPIMethods::add_page_to_level($level_id, $args) in core/api-helper/class-api-methods.php