API Functions

WP-Members has several functions that can be used for customizing how your install works and operates.  These can be used in conjunction with the various filter and action hooks as well as shortcodes.

Form Pages and URLs

Forms

  • wpmem_form_field() – creates a form field.
  • wpmem_form_label() – creates a field label.
  • wpmem_fields() – gets the form fields settings array.
  • wpmem_login_form()
  • wpmem_wp_login_form()
  • wpmem_register_form()
  • wpmem_change_password_form()
  • wpmem_reset_password_form()
  • wpmem_forgot_username_form()
  • wpmem_sanitize_class()
  • wpmem_sanitize_array()
  • wpmem_sanitize_field()
  • wpmem_form_nonce()
  • WP_Members_Captcha
  • wpmem_field_display_value()
  • wpmem_checkbox_field_display()
  • wpmem_select_field_display()

Dialogs and Emails

User Functions

  • wpmem_is_user() – returns boolean (true|false) to check if a user is a WP user.
  • wpmem_get_user_id() – returns a user ID from a username or email.
  • wpmem_get_user_obj() – returns a user object from a user ID, username, or email.
  • wpmem_get_user_role() – returns the user’s current role as an array, false if no role.
  • wpmem_user_has_role() – checks if a user has a specific role.
  • wpmem_get_user_meta() – functions exactly like WP’s get_user_meta(), but without the need for $single (always returns a string).
  • wpmem_get_user_meta_checkbox() – returns a user’s saved result for a specified checkbox field.
  • wpmem_get_user_meta_select() – returns a user’s saved result for a specified select (dropdown) field.
  • wpmem_get_user_meta_radio() – returns a user’s saved result for a specified radio field.
  • wpmem_get_user_meta_multi() – returns a user’s saved result for a specified multiple checkbox or multiple select field as a string.
  • wpmem_user_has_meta() – checks if a user has a given meta value.
  • wpmem_is_user_activated() – checks if the current or requested user is activated.
  • wpmem_user_data() – returns an array of the user’s registration data.
  • wpmem_update_user_role() – updates a user’s role.
  • wpmem_user_has_access() – checks if a user can access a restricted post.
  • wpmem_user_is_current() – similar to wpmem_user_has_access(), but specifically checks expiration.
  • wpmem_get_user_expiration() – gets a user’s expiration date for a specified membership.
  • wpmem_set_user_membership() – assigns product access to a user.
  • wpmem_remove_user_product() – removes product access from a user.
  • wpmem_get_user_products() – gets all memberships for a user.
  • wpmem_set_as_logged_in() – sets a user as logged in.
  • wpmem_login() – logs the user in using wp_signon().
  • wpmem_logout() – logs the user out, destroy session.
  • wpmem_create_membership_number() – creates a membership number.
  • wpmem_activate_user() – sets activation flag (for moderated registration).
  • wpmem_deactivate_user() – sets activation flag to 0.
  • wpmem_set_user_status() – sets the WP user_status value according to activated/deactivated.
  • wpmem_get_user_ip() – gets the current user’s IP address.
  • wpmem_export_users()
  • wpmem_get_users_by_meta()
  • wpmem_get_pending_users()
  • wpmem_get_activated_users()
  • wpmem_get_deactivated_users()

Memberships

  • wpmem_get_membership_post_list()
  • wpmem_get_post_memberships()
  • wpmem_get_access_message()
  • wpmem_get_memberships()
  • wpmem_get_memberships_ids()
  • wpmem_get_membership_id()
  • wpmem_get_membership_name()
  • wpmem_get_membership_slug()
  • wpmem_get_membership_meta()
  • wpmem_add_membership_to_post()
  • wpmem_add_membership_to_posts()
  • wpmem_create_membership()

Utilities

  • wpmem_get() – utility to check posted variables and query strings.
  • wpmem_securify() – filters the main content variable.
  • wpmem_do_excerpt()
  • wpmem_get_excluded_meta()
  • wpmem_use_ssl() – checks if ssl is being used and returns https:// or http:// accordingly.
  • wpmem_force_ssl() – forces a given URL to use ssl (https://).
  • wpmem_write_log()
  • wpmem_array_insert() – inserts array items at specific point in an array.
  • wpmem_load_dropins() – loads dropin code snippets.
  • wpmem_format_date() – formats a given date.
  • wpmem_do_shortcode() – executes a given shortcode (any shortcode, not just WP-Members) without running the full shortcode regex.
  • wpmem_get_sub_str()
  • wpmem_texturize()
  • wpmem_format_date()
  • wpmem_user_sets_password() – checks if a password field is part of registration.
  • wpmem_maybe_unserialize()
  • wpmem_get_suffix()
  • wpmem_get_hidden_posts()
  • wpmem_update_hidden_posts()
  • wpmem_is_rest()

Extension API Functions

MailChimp Integration