Function Reference Archives - WordPress Membership Plugin - Membership Sites https://wishlistmember.com Quickly Protect Your Content With WishList Member Tue, 06 Jan 2015 17:22:35 +0000 en-US hourly 1 https://wordpress.org/?v=6.4.2 https://wishlistmember.com/wp-content/uploads/2020/03/cropped-WishList-Member-logomark-32x32.png Function Reference Archives - WordPress Membership Plugin - Membership Sites https://wishlistmember.com 32 32 Function Reference: wlmapi_get_member_by https://wishlistmember.com/docs/function-reference-wlmapi_get_member_by/ Tue, 06 Jan 2015 17:22:35 +0000 http://codex.wishlistproducts.com/?p=354 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); […]

The post Function Reference: wlmapi_get_member_by appeared first on WordPress Membership Plugin - Membership Sites.]]>
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);
?>

Example Output

Array
(
    [success] => 1
    [member] => Array
        (
            [0] => Array
                (
                    [ID] => 1
                    [UserInfo] => Array
                        (
                            [ID] => 1
                            [caps] => Array
                                (
                                    [SPF Manage Options] => 1
                                    [SPF Manage Forums] => 1
                                    [SPF Manage User Groups] => 1
                                    [SPF Manage Permissions] => 1
                                    [SPF Manage Tags] => 1
                                    [SPF Manage Components] => 1
                                    [SPF Manage Admins] => 1
                                    [SPF Manage Users] => 1
                                    [SPF Manage Profiles] => 1
                                    [SPF Manage Toolbox] => 1
                                    [SPF Manage Configuration] => 1
                                    [gform_full_access] => 1
                                    [SPF Manage Themes] => 1
                                    [SPF Manage Plugins] => 1
                                    [administrator] => 1
                                )

                            [cap_key] => wp_capabilities
                            [roles] => Array
                                (
                                    [14] => administrator
                                )

                            [allcaps] => Array
                                (
                                    [switch_themes] => 1
                                    [edit_themes] => 1
                                    [activate_plugins] => 1
                                    [edit_plugins] => 1
                                    [edit_users] => 1
                                    [edit_files] => 1
                                    [manage_options] => 1
                                    [moderate_comments] => 1
                                    [manage_categories] => 1
                                    [manage_links] => 1
                                    [upload_files] => 1
                                    [import] => 1
                                    [unfiltered_html] => 1
                                    [edit_posts] => 1
                                    [edit_others_posts] => 1
                                    [edit_published_posts] => 1
                                    [publish_posts] => 1
                                    [edit_pages] => 1
                                    [read] => 1
                                    [level_10] => 1
                                    [level_9] => 1
                                    [level_8] => 1
                                    [level_7] => 1
                                    [level_6] => 1
                                    [level_5] => 1
                                    [level_4] => 1
                                    [level_3] => 1
                                    [level_2] => 1
                                    [level_1] => 1
                                    [level_0] => 1
                                    [edit_others_pages] => 1
                                    [edit_published_pages] => 1
                                    [publish_pages] => 1
                                    [delete_pages] => 1
                                    [delete_others_pages] => 1
                                    [delete_published_pages] => 1
                                    [delete_posts] => 1
                                    [delete_others_posts] => 1
                                    [delete_published_posts] => 1
                                    [delete_private_posts] => 1
                                    [edit_private_posts] => 1
                                    [read_private_posts] => 1
                                    [delete_private_pages] => 1
                                    [edit_private_pages] => 1
                                    [read_private_pages] => 1
                                    [delete_users] => 1
                                    [create_users] => 1
                                    [unfiltered_upload] => 1
                                    [edit_dashboard] => 1
                                    [update_plugins] => 1
                                    [delete_plugins] => 1
                                    [install_plugins] => 1
                                    [update_themes] => 1
                                    [install_themes] => 1
                                    [update_core] => 1
                                    [list_users] => 1
                                    [remove_users] => 1
                                    [add_users] => 1
                                    [promote_users] => 1
                                    [edit_theme_options] => 1
                                    [delete_themes] => 1
                                    [export] => 1
                                    [SPF Manage Options] => 1
                                    [SPF Manage Forums] => 1
                                    [SPF Manage User Groups] => 1
                                    [SPF Manage Permissions] => 1
                                    [SPF Manage Tags] => 1
                                    [SPF Manage Components] => 1
                                    [SPF Manage Admins] => 1
                                    [SPF Manage Users] => 1
                                    [SPF Manage Profiles] => 1
                                    [SPF Manage Toolbox] => 1
                                    [SPF Manage Configuration] => 1
                                    [gform_full_access] => 1
                                    [SPF Manage Themes] => 1
                                    [SPF Manage Plugins] => 1
                                    [administrator] => 1
                                )

                            [filter] => 
                            [user_login] => username
                            [user_nicename] => username
                            [user_email] => email@domain.com
                            [user_url] => 
                            [user_registered] => 2012-06-18 20:00:43
                            [user_activation_key] => 
                            [user_status] => 0
                            [display_name] => John Morris
                            [custom_] => 
                            [custom_0] => 
                            [custom_john_test] => 
                            [wpm_login_date] => 1355154059
                            [wpm_login_ip] => 127.0.0.1
                            [wpm_login_limit] => 
                            [wpm_useraddress] => Array
                                (
                                    [company] => 
                                    [address1] => 
                                    [address2] => 
                                    [city] => 
                                    [state] => 
                                    [zip] => 
                                    [country] => Select Country
                                )

                        )

                    [Sequential] => 
                    [Levels] => Array
                        (
                            [1340726008] => stdClass Object
                                (
                                    [Level_ID] => 1340726008
                                    [Name] => Test Level 1
                                    [Cancelled] => 
                                    [CancelDate] => 
                                    [Pending] => 
                                    [UnConfirmed] => 
                                    [Expired] => 
                                    [ExpiryDate] => 
                                    [Active] => 1
                                    [Status] => Array
                                        (
                                            [0] => Active
                                        )

                                    [Timestamp] => 1354299649
                                    [TxnID] => WL-1-1340726008
                                )

                            [1340896239] => stdClass Object
                                (
                                    [Level_ID] => 1340896239
                                    [Name] => Test Level 2
                                    [Cancelled] => 
                                    [CancelDate] => 
                                    [Pending] => 
                                    [UnConfirmed] => 
                                    [Expired] => 
                                    [ExpiryDate] => 
                                    [Active] => 1
                                    [Status] => Array
                                        (
                                            [0] => Active
                                        )

                                    [Timestamp] => 1354299023
                                    [TxnID] => WL-1-1340896239
                                )

                        )

                )

        )

    [supported_verbs] => Array
        (
            [0] => GET
            [1] => PUT
            [2] => DELETE
        )

)

Notes

This functions returns WLMAPIMethods::get_member_by($field, $value) in core/api-helper/class-api-methods.php

The post Function Reference: wlmapi_get_member_by appeared first on WordPress Membership Plugin - Membership Sites.]]>
Function Reference: WishListMemberAPIRequest https://wishlistmember.com/docs/function-reference-wishlistmemberapirequest/ Mon, 10 Dec 2012 19:31:18 +0000 http://wishlistproducts.com/codex/?p=248 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 […]

The post Function Reference: WishListMemberAPIRequest appeared first on WordPress Membership Plugin - Membership Sites.]]>
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 by some requests)

Return

Returns the result of the API request.

Example Code

<?php
     $args = array('name' => 'Test Level 4');
     $response = WishListMemberAPIRequest('/levels', 'POST', $args);
     print_r($response);
?>

Example Output

Array
(
    [success] => 1
    [level] => Array
        (
            [id] => 1344363854
            [name] => Test Level 4
            [registration_url] => BFKdgl
            [after_login_redirect] => global
            [after_registration_redirect] => global
            [access_all_pages] => 0
            [access_all_categories] => 0
            [access_all_posts] => 0
            [access_all_comments] => 0
            [no_expiry] => 1
            [expiry] => 
            [expiry_period] => Days
            [sequential_upgrade_to] => 
            [sequential_upgrade_after] => 
            [sequential_upgrade_method] => 
            [member_count] => 
            [require_captcha] => 0
            [require_email_confirmation] => 0
            [require_admin_approval] => 0
            [grant_continued_access] => 0
            [disable_existing_users_link] => 0
            [registration_date_reset] => 0
            [uncancel_on_registration] => 0
            [wordpress_role] => subscriber
            [level_order] => 
            [remove_from_levels] => 
            [_more_] => Array
                (
                    [0] => /levels/1344363854/members
                    [1] => /levels/1344363854/posts
                    [2] => /levels/1344363854/pages
                    [3] => /levels/1344363854/comments
                    [4] => /levels/1344363854/categories
                )

        )

    [supported_verbs] => Array
        (
            [0] => GET
            [1] => PUT
            [2] => DELETE
        )

)

Notes

This function can be found at core/Functions.php

The post Function Reference: WishListMemberAPIRequest appeared first on WordPress Membership Plugin - Membership Sites.]]>
Function Reference: wlmapi_unmanage_post https://wishlistmember.com/docs/function-reference-wlmapi_unmanage_post/ Mon, 10 Dec 2012 17:41:37 +0000 http://wishlistproducts.com/codex/?p=230 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 ( […]

The post Function Reference: wlmapi_unmanage_post appeared first on WordPress Membership Plugin - Membership Sites.]]>
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
(
    [0] => Array
        (
            [success] => 1
            [supported_verbs] => Array
                (
                    [0] => GET
                    [1] => DELETE
                )

        )

    [1] => Array
        (
            [success] => 1
            [supported_verbs] => Array
                (
                    [0] => GET
                    [1] => DELETE
                )

        )

    [2] => Array
        (
            [success] => 1
            [supported_verbs] => Array
                (
                    [0] => GET
                    [1] => DELETE
                )

        )

)

Notes

This functions returns WLMAPIMethods::unmanage_post($level_id, $post_ids) in core/api-helper/class-api-methods.php

The post Function Reference: wlmapi_unmanage_post appeared first on WordPress Membership Plugin - Membership Sites.]]>
Function Reference: wlmapi_manage_post https://wishlistmember.com/docs/function-reference-wlmapi_manage_post/ Mon, 10 Dec 2012 17:38:09 +0000 http://wishlistproducts.com/codex/?p=226 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 […]

The post Function Reference: wlmapi_manage_post appeared first on WordPress Membership Plugin - Membership Sites.]]>
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

<?php
     $posts = wlmapi_manage_post(1340726008, '1,60,62');
     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
                        )

                    [2] => Array
                        (
                            [ID] => 62
                            [name] => Another Post with Everything In It 
                            [_more_] => /levels/1340726008/posts/62
                        )

                    [3] => Array
                        (
                            [ID] => 60
                            [name] => An Ordered List Post
                            [_more_] => /levels/1340726008/posts/60
                        )

                )

        )

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

)

Notes

This functions returns WLMAPIMethods::manage_post($level_id, $post_ids) in core/api-helper/class-api-methods.php

The post Function Reference: wlmapi_manage_post appeared first on WordPress Membership Plugin - Membership Sites.]]>
Function Reference: wlmapi_is_user_a_member https://wishlistmember.com/docs/function-reference-wlmapi_is_user_a_member/ Mon, 10 Dec 2012 17:24:11 +0000 http://wishlistproducts.com/codex/?p=222 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 ) […]

The post Function Reference: wlmapi_is_user_a_member appeared first on WordPress Membership Plugin - Membership Sites.]]>
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 ) {
          echo 'User is a member';
     } else {
          echo 'User is not a member';
     }
?>

Example Output

User is a member

Notes

This functions returns WLMAPIMethods::is_user_a_member($level_id, $member_id) in core/api-helper/class-api-methods.php

The post Function Reference: wlmapi_is_user_a_member appeared first on WordPress Membership Plugin - Membership Sites.]]>
Function Reference: wlmapi_delete_member https://wishlistmember.com/docs/function-reference-wlmapi_delete_member/ Mon, 10 Dec 2012 17:17:50 +0000 http://wishlistproducts.com/codex/?p=217 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 […]

The post Function Reference: wlmapi_delete_member appeared first on WordPress Membership Plugin - Membership Sites.]]>
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 functions returns WLMAPIMethods::delete_member($member_id) in core/api-helper/class-api-methods.php

The post Function Reference: wlmapi_delete_member appeared first on WordPress Membership Plugin - Membership Sites.]]>
Function Reference: wlmapi_update_member https://wishlistmember.com/docs/function-reference-wlmapi_update_member/ Mon, 10 Dec 2012 17:12:30 +0000 http://wishlistproducts.com/codex/?p=210 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) […]

The post Function Reference: wlmapi_update_member appeared first on WordPress Membership Plugin - Membership Sites.]]>
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) Address line #1 Optional
address2 (string) Address line #2 Optional
city (string) City Optional
state (string) State Optional
zip (string) Zip code Optional
country (string) Country Optional
wpm_login_limit (int) Number of concurrent logins to allow per IP Optional
wpm_registration_ip (string) IP address during user registration Optional
custom_{field} (string) Custom fields. Custom fields can be added by prepending a variable name with “custom_” (e.g. custom_phone) Optional
Sequential (integer) 1-Set Sequential Upgrade to ON
0-Set Sequential Upgrade to OFF
Optional
Levels (array) Array of membership level IDs to add the user to Optional
RemoveLevels (array) Array of membership level IDs to remove the user from Optional

Return

Returns a multi-dimensional array containing operation status and an array containing full member data for the newly updated user.

Example Code

<?php
     $args = array(
          'user_email' => 'updatedemail@wlptest.com',
          'Levels' => array(1340896250)
     );
     $member = wlmapi_update_member($args);
     print_r($member);
?>

Example Output

Array
(
    [success] => 1
    [member] => Array
        (
            [0] => Array
                (
                    [ID] => 1
                    [UserInfo] => Array
                        (
                            [ID] => 1
                            [caps] => Array
                                (
                                    [SPF Manage Options] => 1
                                    [SPF Manage Forums] => 1
                                    [SPF Manage User Groups] => 1
                                    [SPF Manage Permissions] => 1
                                    [SPF Manage Tags] => 1
                                    [SPF Manage Components] => 1
                                    [SPF Manage Admins] => 1
                                    [SPF Manage Users] => 1
                                    [SPF Manage Profiles] => 1
                                    [SPF Manage Toolbox] => 1
                                    [SPF Manage Configuration] => 1
                                    [gform_full_access] => 1
                                    [SPF Manage Themes] => 1
                                    [SPF Manage Plugins] => 1
                                    [administrator] => 1
                                )

                            [cap_key] => wp_capabilities
                            [roles] => Array
                                (
                                    [14] => administrator
                                )

                            [allcaps] => Array
                                (
                                    [switch_themes] => 1
                                    [edit_themes] => 1
                                    [activate_plugins] => 1
                                    [edit_plugins] => 1
                                    [edit_users] => 1
                                    [edit_files] => 1
                                    [manage_options] => 1
                                    [moderate_comments] => 1
                                    [manage_categories] => 1
                                    [manage_links] => 1
                                    [upload_files] => 1
                                    [import] => 1
                                    [unfiltered_html] => 1
                                    [edit_posts] => 1
                                    [edit_others_posts] => 1
                                    [edit_published_posts] => 1
                                    [publish_posts] => 1
                                    [edit_pages] => 1
                                    [read] => 1
                                    [level_10] => 1
                                    [level_9] => 1
                                    [level_8] => 1
                                    [level_7] => 1
                                    [level_6] => 1
                                    [level_5] => 1
                                    [level_4] => 1
                                    [level_3] => 1
                                    [level_2] => 1
                                    [level_1] => 1
                                    [level_0] => 1
                                    [edit_others_pages] => 1
                                    [edit_published_pages] => 1
                                    [publish_pages] => 1
                                    [delete_pages] => 1
                                    [delete_others_pages] => 1
                                    [delete_published_pages] => 1
                                    [delete_posts] => 1
                                    [delete_others_posts] => 1
                                    [delete_published_posts] => 1
                                    [delete_private_posts] => 1
                                    [edit_private_posts] => 1
                                    [read_private_posts] => 1
                                    [delete_private_pages] => 1
                                    [edit_private_pages] => 1
                                    [read_private_pages] => 1
                                    [delete_users] => 1
                                    [create_users] => 1
                                    [unfiltered_upload] => 1
                                    [edit_dashboard] => 1
                                    [update_plugins] => 1
                                    [delete_plugins] => 1
                                    [install_plugins] => 1
                                    [update_themes] => 1
                                    [install_themes] => 1
                                    [update_core] => 1
                                    [list_users] => 1
                                    [remove_users] => 1
                                    [add_users] => 1
                                    [promote_users] => 1
                                    [edit_theme_options] => 1
                                    [delete_themes] => 1
                                    [export] => 1
                                    [SPF Manage Options] => 1
                                    [SPF Manage Forums] => 1
                                    [SPF Manage User Groups] => 1
                                    [SPF Manage Permissions] => 1
                                    [SPF Manage Tags] => 1
                                    [SPF Manage Components] => 1
                                    [SPF Manage Admins] => 1
                                    [SPF Manage Users] => 1
                                    [SPF Manage Profiles] => 1
                                    [SPF Manage Toolbox] => 1
                                    [SPF Manage Configuration] => 1
                                    [gform_full_access] => 1
                                    [SPF Manage Themes] => 1
                                    [SPF Manage Plugins] => 1
                                    [administrator] => 1
                                )

                            [filter] => 
                            [user_login] => username
                            [user_nicename] => username
                            [user_email] => updatedemail@wlptest.com
                            [user_url] => 
                            [user_registered] => 2012-06-18 20:00:43
                            [user_activation_key] => 
                            [user_status] => 0
                            [display_name] => John Morris
                            [custom_] => 
                            [custom_0] => 
                            [custom_john_test] => 
                            [wpm_login_date] => 1355159065
                            [wpm_login_ip] => 127.0.0.1
                            [wpm_login_limit] => 
                            [wpm_useraddress] => Array
                                (
                                    [company] => 
                                    [address1] => 
                                    [address2] => 
                                    [city] => 
                                    [state] => 
                                    [zip] => 
                                    [country] => Select Country
                                )

                        )

                    [Sequential] => 
                    [Levels] => Array
                        (
                            [1340726008] => stdClass Object
                                (
                                    [Level_ID] => 1340726008
                                    [Name] => Test Level 1
                                    [Cancelled] => 
                                    [CancelDate] => 
                                    [Pending] => 
                                    [UnConfirmed] => 
                                    [Expired] => 
                                    [ExpiryDate] => 
                                    [Active] => 1
                                    [Status] => Array
                                        (
                                            [0] => Active
                                        )

                                    [Timestamp] => 1354299649
                                    [TxnID] => WL-1-1340726008
                                )

                            [1340896239] => stdClass Object
                                (
                                    [Level_ID] => 1340896239
                                    [Name] => Test Level 2
                                    [Cancelled] => 
                                    [CancelDate] => 
                                    [Pending] => 
                                    [UnConfirmed] => 
                                    [Expired] => 
                                    [ExpiryDate] => 
                                    [Active] => 1
                                    [Status] => Array
                                        (
                                            [0] => Active
                                        )

                                    [Timestamp] => 1354299023
                                    [TxnID] => WL-1-1340896239
                                )

                            [1340896250] => stdClass Object
                                (
                                    [Level_ID] => 1340896250
                                    [Name] => Test Level 3
                                    [Cancelled] => 
                                    [CancelDate] => 
                                    [Pending] => 
                                    [UnConfirmed] => 
                                    [Expired] => 
                                    [ExpiryDate] => 
                                    [Active] => 1
                                    [Status] => Array
                                        (
                                            [0] => Active
                                        )

                                    [Timestamp] => 1355159414
                                    [TxnID] => WL-1-1340896250
                                )

                        )

                )

        )

    [supported_verbs] => Array
        (
            [0] => GET
            [1] => PUT
            [2] => DELETE
        )

)

Notes

This functions returns WLMAPIMethods::update_member($args) in core/api-helper/class-api-methods.php

The post Function Reference: wlmapi_update_member appeared first on WordPress Membership Plugin - Membership Sites.]]>
Function Reference: wlmapi_get_member_levels https://wishlistmember.com/docs/function-reference-wlmapi_get_member_levels/ Mon, 10 Dec 2012 17:01:48 +0000 http://wishlistproducts.com/codex/?p=207 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] […]

The post Function Reference: wlmapi_get_member_levels appeared first on WordPress Membership Plugin - Membership Sites.]]>
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] => Test Level 1
            [Cancelled] => 
            [CancelDate] => 
            [Pending] => 
            [UnConfirmed] => 
            [Expired] => 
            [ExpiryDate] => 
            [Active] => 1
            [Status] => Array
                (
                    [0] => Active
                )

            [Timestamp] => 1354299649
            [TxnID] => WL-1-1340726008
        )

    [1340896239] => stdClass Object
        (
            [Level_ID] => 1340896239
            [Name] => Test Level 2
            [Cancelled] => 
            [CancelDate] => 
            [Pending] => 
            [UnConfirmed] => 
            [Expired] => 
            [ExpiryDate] => 
            [Active] => 1
            [Status] => Array
                (
                    [0] => Active
                )

            [Timestamp] => 1354299023
            [TxnID] => WL-1-1340896239
        )

)

Notes

This functions returns WLMAPIMethods::get_member_levels($member_id) in core/api-helper/class-api-methods.php

The post Function Reference: wlmapi_get_member_levels appeared first on WordPress Membership Plugin - Membership Sites.]]>
Function Reference: wlmapi_get_member https://wishlistmember.com/docs/function-reference-wlmapi_get_member/ Mon, 10 Dec 2012 16:57:50 +0000 http://wishlistproducts.com/codex/?p=203 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 […]

The post Function Reference: wlmapi_get_member appeared first on WordPress Membership Plugin - Membership Sites.]]>
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
                    [UserInfo] => Array
                        (
                            [ID] => 1
                            [caps] => Array
                                (
                                    [SPF Manage Options] => 1
                                    [SPF Manage Forums] => 1
                                    [SPF Manage User Groups] => 1
                                    [SPF Manage Permissions] => 1
                                    [SPF Manage Tags] => 1
                                    [SPF Manage Components] => 1
                                    [SPF Manage Admins] => 1
                                    [SPF Manage Users] => 1
                                    [SPF Manage Profiles] => 1
                                    [SPF Manage Toolbox] => 1
                                    [SPF Manage Configuration] => 1
                                    [gform_full_access] => 1
                                    [SPF Manage Themes] => 1
                                    [SPF Manage Plugins] => 1
                                    [administrator] => 1
                                )

                            [cap_key] => wp_capabilities
                            [roles] => Array
                                (
                                    [14] => administrator
                                )

                            [allcaps] => Array
                                (
                                    [switch_themes] => 1
                                    [edit_themes] => 1
                                    [activate_plugins] => 1
                                    [edit_plugins] => 1
                                    [edit_users] => 1
                                    [edit_files] => 1
                                    [manage_options] => 1
                                    [moderate_comments] => 1
                                    [manage_categories] => 1
                                    [manage_links] => 1
                                    [upload_files] => 1
                                    [import] => 1
                                    [unfiltered_html] => 1
                                    [edit_posts] => 1
                                    [edit_others_posts] => 1
                                    [edit_published_posts] => 1
                                    [publish_posts] => 1
                                    [edit_pages] => 1
                                    [read] => 1
                                    [level_10] => 1
                                    [level_9] => 1
                                    [level_8] => 1
                                    [level_7] => 1
                                    [level_6] => 1
                                    [level_5] => 1
                                    [level_4] => 1
                                    [level_3] => 1
                                    [level_2] => 1
                                    [level_1] => 1
                                    [level_0] => 1
                                    [edit_others_pages] => 1
                                    [edit_published_pages] => 1
                                    [publish_pages] => 1
                                    [delete_pages] => 1
                                    [delete_others_pages] => 1
                                    [delete_published_pages] => 1
                                    [delete_posts] => 1
                                    [delete_others_posts] => 1
                                    [delete_published_posts] => 1
                                    [delete_private_posts] => 1
                                    [edit_private_posts] => 1
                                    [read_private_posts] => 1
                                    [delete_private_pages] => 1
                                    [edit_private_pages] => 1
                                    [read_private_pages] => 1
                                    [delete_users] => 1
                                    [create_users] => 1
                                    [unfiltered_upload] => 1
                                    [edit_dashboard] => 1
                                    [update_plugins] => 1
                                    [delete_plugins] => 1
                                    [install_plugins] => 1
                                    [update_themes] => 1
                                    [install_themes] => 1
                                    [update_core] => 1
                                    [list_users] => 1
                                    [remove_users] => 1
                                    [add_users] => 1
                                    [promote_users] => 1
                                    [edit_theme_options] => 1
                                    [delete_themes] => 1
                                    [export] => 1
                                    [SPF Manage Options] => 1
                                    [SPF Manage Forums] => 1
                                    [SPF Manage User Groups] => 1
                                    [SPF Manage Permissions] => 1
                                    [SPF Manage Tags] => 1
                                    [SPF Manage Components] => 1
                                    [SPF Manage Admins] => 1
                                    [SPF Manage Users] => 1
                                    [SPF Manage Profiles] => 1
                                    [SPF Manage Toolbox] => 1
                                    [SPF Manage Configuration] => 1
                                    [gform_full_access] => 1
                                    [SPF Manage Themes] => 1
                                    [SPF Manage Plugins] => 1
                                    [administrator] => 1
                                )

                            [filter] => 
                            [user_login] => username
                            [user_nicename] => username
                            [user_email] => totallyfake@wlptest.com
                            [user_url] => 
                            [user_registered] => 2012-06-18 20:00:43
                            [user_activation_key] => 
                            [user_status] => 0
                            [display_name] => John Morris
                            [custom_] => 
                            [custom_0] => 
                            [custom_john_test] => 
                            [wpm_login_date] => 1355154059
                            [wpm_login_ip] => 127.0.0.1
                            [wpm_login_limit] => 
                            [wpm_useraddress] => Array
                                (
                                    [company] => 
                                    [address1] => 
                                    [address2] => 
                                    [city] => 
                                    [state] => 
                                    [zip] => 
                                    [country] => Select Country
                                )

                        )

                    [Sequential] => 
                    [Levels] => Array
                        (
                            [1340726008] => stdClass Object
                                (
                                    [Level_ID] => 1340726008
                                    [Name] => Test Level 1
                                    [Cancelled] => 
                                    [CancelDate] => 
                                    [Pending] => 
                                    [UnConfirmed] => 
                                    [Expired] => 
                                    [ExpiryDate] => 
                                    [Active] => 1
                                    [Status] => Array
                                        (
                                            [0] => Active
                                        )

                                    [Timestamp] => 1354299649
                                    [TxnID] => WL-1-1340726008
                                )

                            [1340896239] => stdClass Object
                                (
                                    [Level_ID] => 1340896239
                                    [Name] => Test Level 2
                                    [Cancelled] => 
                                    [CancelDate] => 
                                    [Pending] => 
                                    [UnConfirmed] => 
                                    [Expired] => 
                                    [ExpiryDate] => 
                                    [Active] => 1
                                    [Status] => Array
                                        (
                                            [0] => Active
                                        )

                                    [Timestamp] => 1354299023
                                    [TxnID] => WL-1-1340896239
                                )

                        )

                )

        )

    [supported_verbs] => Array
        (
            [0] => GET
            [1] => PUT
            [2] => DELETE
        )

)

Notes

This functions returns WLMAPIMethods::get_member($member_id) in core/api-helper/class-api-methods.php

The post Function Reference: wlmapi_get_member appeared first on WordPress Membership Plugin - Membership Sites.]]>
Function Reference: wlmapi_add_member https://wishlistmember.com/docs/function-reference-wlmapi_add_member/ Mon, 10 Dec 2012 16:01:22 +0000 http://wishlistproducts.com/codex/?p=197 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 […]

The post Function Reference: wlmapi_add_member appeared first on WordPress Membership Plugin - Membership Sites.]]>
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 Optional
city (string) City Optional
state (string) State Optional
zip (string) Zip code Optional
country (string) Country Optional
wpm_login_limit (int) Number of concurrent logins to allow per IP Optional
wpm_registration_ip (string) IP address during user registration Optional
custom_{field} (string) Custom fields. Custom fields can be added by prepending a variable name with “custom_” (e.g. custom_phone) Optional
Sequential (boolean) Enables/Disables sequential upgrade for user Optional
Levels (array) Array of membership level IDs to add the user to Optional
RemoveLevels (array) Array of membership level IDs to remove the user from Optional
SendMail (boolean) Send appropriate WishList Member emails or not. (Requires the “Levels” parameter to be set in order to work.) Optional
SendMailPerLevel (boolean) Send appropriate WishList Member emails based on the per level settings. (Requires the “Levels” parameter to be set in order to work.) Optional
ObeyRegistrationRequirements (boolean) Follows the configured settings in the Setup > Levels > *Click to edit Level* > Requirements section of WishList Member. (Requires the “Levels” parameter to be set in order to work.) Optional

Return

Returns a multi-dimensional array containing operation status and an array containing full member data for the newly added user.

Example Code

<?php
     $args = array(
          'user_login' => 'johnistheman,
          'user_email' => 'jmodaman@wlptest.com',
          'Levels' => array(1340726008, 1340896239)
     );
     $member = wlmapi_add_member($args);
     print_r($member);
?>

Example Output

Array
(
    [success] => 1
    [member] => Array
        (
            [0] => Array
                (
                    [ID] => 13
                    [UserInfo] => Array
                        (
                            [ID] => 13
                            [caps] => Array
                                (
                                    [subscriber] => 1
                                )

                            [cap_key] => wp_capabilities
                            [roles] => Array
                                (
                                    [0] => subscriber
                                )

                            [allcaps] => Array
                                (
                                    [read] => 1
                                    [level_0] => 1
                                    [subscriber] => 1
                                )

                            [filter] => 
                            [user_login] => johnistheman
                            [user_nicename] => johnistheman
                            [user_email] => jmodaman@wlptest.com
                            [user_url] => 
                            [user_registered] => 2012-12-10 15:54:56
                            [user_activation_key] => 
                            [user_status] => 0
                            [display_name] => johnistheman
                            [wpm_useraddress] => 0
                        )

                    [Sequential] => 
                    [Levels] => Array
                        (
                            [1340726008] => stdClass Object
                                (
                                    [Level_ID] => 1340726008
                                    [Name] => Test Level 1
                                    [Cancelled] => 
                                    [CancelDate] => 
                                    [Pending] => 
                                    [UnConfirmed] => 
                                    [Expired] => 
                                    [ExpiryDate] => 
                                    [Active] => 1
                                    [Status] => Array
                                        (
                                            [0] => Active
                                        )

                                    [Timestamp] => 1355154896
                                    [TxnID] => WL-13-1340726008
                                )

                            [1340896239] => stdClass Object
                                (
                                    [Level_ID] => 1340896239
                                    [Name] => Test Level 2
                                    [Cancelled] => 
                                    [CancelDate] => 
                                    [Pending] => 
                                    [UnConfirmed] => 
                                    [Expired] => 
                                    [ExpiryDate] => 
                                    [Active] => 1
                                    [Status] => Array
                                        (
                                            [0] => Active
                                        )

                                    [Timestamp] => 1355154896
                                    [TxnID] => WL-13-1340896239
                                )

                        )

                )

        )

    [supported_verbs] => Array
        (
            [0] => GET
            [1] => PUT
            [2] => DELETE
        )

)

Notes

This functions returns WLMAPIMethods::add_member($args) in core/api-helper/class-api-methods.php

The post Function Reference: wlmapi_add_member appeared first on WordPress Membership Plugin - Membership Sites.]]>