Archive | API Documentation RSS feed for this section

Function Reference: wlmapi_is_user_a_member

Checks if the specified member belongs to the specified level. Parameters level_id (int) – The ID of the level to check member_id (int) – The ID of the member to check Return Returns TRUE if the user belongs to the level and FALSE if not. Example Code <?php $check = wlmapi_is_user_a_member(1340726008, 1); if ( $check ) […]

Function Reference: wlmapi_delete_member

Deletes an existing member. Parameters member_id (int) – The ID of the member to delete Return Returns a multi-dimensional array containing the operation status. Example Code <?php $member = wlmapi_delete_member(13); print_r($member); ?> Example Output Array ( [success] => 1 [supported_verbs] => Array ( [0] => GET [1] => PUT [2] => DELETE ) ) Notes This […]

Function Reference: wlmapi_update_member

Updates a member according to the specified arguments. Parameters user_id (int) – The ID of the member to update args (array) – An array of accepted arguments specified below: Parameter Description Required Default user_login (string) User login (username) Required user_email (string) User’s email address Required user_pass (string) Password. Auto-generated if not specified Optional  auto-generated company (string) Company name Optional address1 (string) […]

Function Reference: wlmapi_get_member_levels

Retrieves the membership levels that the specified user belongs to. Parameters member_id (int) – The ID of the member Return Returns a multi-dimensional array containing data for the levels that the  specified member belongs to. Example Code <?php $levels = wlmapi_get_member_levels(1); print_r($levels); ?> Example Output Array ( [1340726008] => stdClass Object ( [Level_ID] => 1340726008 [Name] […]

Function Reference: wlmapi_get_member

Retrieves all information about the specified member. Parameters member_id (int) – The ID of the member to retrieve Return Returns a multi-dimensional array containing data for the specified member. Example Code <?php $member = wlmapi_get_member(1); print_r($member); ?> Example Output Array ( [success] => 1 [member] => Array ( [0] => Array ( [ID] => 1 […]

Function Reference: wlmapi_add_member

Adds a member to WordPress according to the specified arguments. Parameters args (array) – An array of accepted arguments specified below: Parameter Description Required Default user_login (string) User login (username) Required user_email (string) User’s email address Required user_pass (string) Password. Auto-generated if not specified Optional  auto-generated company (string) Company name Optional address1 (string) Address line #1 Optional address2 (string) Address line #2 […]

Function Reference: wlmapi_the_members

Retrieves a list of all members passed through the filter: wlmapi_the_members. If no filter is applied, this function will return the unfiltered array, i.e. the same output as wlmapi_get_members. Parameters This function accepts no parameters. Return Returns a string containing the filtered list. Example Code <?php //On the page displaying the levels $members = wlmapi_the_members(); echo […]

Function Reference: wlmapi_get_members

Retrieves all members. Parameters This function accepts no parameters. Return Returns a multi-dimensional array containing data for each member. Example Code <?php $members = wlmapi_get_members(); print_r($members); ?> Example Output Array ( [success] => 1 [members] => Array ( [member] => Array ( [0] => Array ( [id] => 1 [user_login] => john [user_email] => johnistheman@wlptest.com […]

Function Reference: wlmapi_unprotect_category

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

Function Reference: wlmapi_protect_category

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