c_ws_plugin__s2member_user_securities
public class c_ws_plugin__s2member_user_securities
3.5
( 4 Methods ) Method Summary | |
---|---|
public static bool | hide_password_fields(bool $show, obj $user) Hides Password fields for Demo Users; and deals with Password fields on Multisite Blog Farms. |
public static null | Initializes Filter for |
public static bool | ms_allow_edits(bool $allow) Alters this Filter inside |
public static array | user_capabilities(array $capabilities, array $caps_map, array $args) Alters |
public static bool hide_password_fields(bool $show, obj $user)
Hides Password fields for Demo Users; and deals with Password fields on Multisite Blog Farms.
Demo accounts ( where the Username MUST be "demo" ), will NOT be allowed to change their Password.
Any other restrictions you need to impose must be done through custom programming, using s2Member's Conditionals.
See s2Member -› API Scripting
.
3.5
add_filter("show_password_fields");
bool $show - Expects boolean value passed through by the Filter.
obj $user - Expects a WP_User
object passed through by the Filter.
bool - False if the Password is locked for this User, else existing value.
public static null initialize()
Initializes Filter for user_has_cap
.
It's very important that this is NOT attached before WordPress® creates $current_user
via $wp->init()
.
This prevents crashes when other plugins attempt to call upon current_user_can()
before WordPress is initialized.
For instance, some plugins attempt to use current_user_can()
on the plugins_loaded
Hook, which they should not do.
3.5
add_action("init");
null
public static bool ms_allow_edits(bool $allow)
Alters this Filter inside /wp-admin/user-edit.php
.
3.5
add_filter("enable_edit_any_user_configuration");
bool $allow - Expects boolean value passed through by the Filter.
bool - True if the current User is allowed to edit any User, else existing value.
public static array user_capabilities(array $capabilities, array $caps_map, array $args)
Alters WP_User->has_cap()
in special cases for Administrators.
110815
add_filter("user_has_cap");
array $capabilities - Expects an array of Capabilities passed in by the Filter. This array contains all of the Capabilities that the User has ( i.e. $user->allcaps
).
array $caps_map - An array of Capabilities mapped out by the map_meta_cap
function.
array $args - Array of arguments originally passed through the has_cap()
function. However, WordPress® modifies this array of arguments in the following way. Argument [0]
is the Capability test string itself (this is normal). Argument [1]
is added by WordPress®; it's the ID of the User. Other arguments starting from array index [2]
are normal.
array - An array of Capabilities.
User securities.