Source Code Documentation


Field Summary | Method Summary | Field Detail | Method Detail

Package s2Member\User_Securities

s2member\includes\classes\user-securities.inc.php at line #28

Class c_ws_plugin__s2member_user_securities

c_ws_plugin__s2member_user_securities

public class c_ws_plugin__s2member_user_securities

User securities.

Since:

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

initialize()

Initializes Filter for user_has_cap.

public static bool

ms_allow_edits(bool $allow)

Alters this Filter inside /wp-admin/user-edit.php.

public static array

user_capabilities(array $capabilities, array $caps_map, array $args)

Alters WP_User->has_cap() in special cases for Administrators.

( 4 Methods )
Method Detail

s2member\includes\classes\user-securities.inc.php at line #122

hide_password_fields()

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.

Since:

3.5

Attaches-to:

add_filter("show_password_fields");

Parameters:

bool $show - Expects boolean value passed through by the Filter.

obj $user - Expects a WP_User object passed through by the Filter.

Returns:

bool - False if the Password is locked for this User, else existing value.

[ back to top ]

s2member\includes\classes\user-securities.inc.php at line #44

initialize()

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.

Since:

3.5

Attaches-to:

add_action("init");

Returns:

null

[ back to top ]

s2member\includes\classes\user-securities.inc.php at line #92

ms_allow_edits()

public static bool ms_allow_edits(bool $allow)

Alters this Filter inside /wp-admin/user-edit.php.

Since:

3.5

Attaches-to:

add_filter("enable_edit_any_user_configuration");

Parameters:

bool $allow - Expects boolean value passed through by the Filter.

Returns:

bool - True if the current User is allowed to edit any User, else existing value.

[ back to top ]

s2member\includes\classes\user-securities.inc.php at line #66

user_capabilities()

public static array user_capabilities(array $capabilities, array $caps_map, array $args)

Alters WP_User->has_cap() in special cases for Administrators.

Since:

110815

Attaches-to:

add_filter("user_has_cap");

Parameters:

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.

Returns:

array - An array of Capabilities.

[ back to top ]

Source Code Documentation


Field Summary | Method Summary | Field Detail | Method Detail