This is a tutorial article on how to customize the profile links for the logged in state of the [wpmem_profile] shortcode. We will focus on different ways to approach it, all of which use the wpmem_member_links_args
filter hook.
Search Results for: short code
Add or remove fields based on page
Sometimes, you may find that you want to add or remove fields from the registration form based on the page you are on. This may be the case if you set up different registration pages, or you might want to have a specific registration page with certain fields and the automatic forms that show on blocked content have different fields. There are many ways to approach it, but ultimately, it is very simple to add or remove fields from the form with the wpmem_fields
filter.
wpmem_deactivate_user()
Description
Dectivates a user when moderated registration is used.
Parameters
$user_id
(int) (optional) The user ID. If no ID is passed, the current user ID will be used.
Return Value
(void)
Notes
- Triggers wpmem_user_deactivated action
- Also see wpmem_activate_user()
Examples
Changelog
- Introduced in version 2.7.1
- 3.2.4 Renamed from wpmem_a_deactivate_user().
- 3.3.0 Moved to user API
Source
wpmem_deactivate_user() is located in /includes/api-users.php.
wpmem_activate_user()
Description
Activates a user when moderated registration is used.
Parameters
$user_id
(int) (optional) The user ID. If no ID is passed, the current user ID will be used.
$notify
(boolean) (optional) Send email notification to user when activated. Defaults to true.
$set_pwd
(boolean) (optional) Sets a password when the user is activated. Defaults to false.
Return Value
(void)
Notes
- Triggers wpmem_user_activated action
- Also see wpmem_deactivate_user()
Examples
Changelog
- Introduced in version 2.4.0
- 3.1.6 Dependencies now loaded by object.
- 3.2.4 Renamed from wpmem_a_activate_user().
- 3.3.0 Moved to user API
- 3.3.5 Added $notify argument.
- 3.4.0 Added $set_pwd argument.
Source
wpmem_activate_user() is located in /includes/api-users.php.
wpmem_is_user_activated()
Description
Checks if a user is activated when moderated registration is used.
Parameters
$user_id
(int) (optional) The user ID. If not ID is passed, the current user ID will be used.
Return Value
(boolean) Returns true if user is activated, otherwise false.
Examples
Changelog
Introduced in version 3.1.7
Added as an alias of WP_Members_Users::is_user_activated() in 3.2.3
Source
wpmem_is_user_activated() is located in /includes/api-users.php.