Archive | Functions RSS feed for this section

Function Reference: wlmapi_get_member_by

Retrieves all information about the specified member by a specified field (name, login). Parameters field (string) – Data type to retrieve member by (user_email or user_login) value (string) – Value of specified data type (e.g. email@domain.com) Return Returns a multi-dimensional array containing data for the specified member. Example Code <?php $member = wlmapi_get_member_by(‘user_email’, ‘email@domain.com’); print_r($member); […]

Function Reference: WishListMemberAPIRequest

Calls the WishList Member API internally. This is the sister function of the wlmapiclass class which handles all external API requests. Parameters request (int) – The resource to request (e.g. “/levels”) method (int) – The method to use (GET, POST, PUT, DELETE). Default is GET data (array) – An associative array of data to pass to the API (required […]

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