Source Code Documentation


Field Summary | Method Summary | Field Detail | Method Detail

Package s2Member\SP_Access

s2member\includes\classes\sp-access.inc.php at line #28

Class c_ws_plugin__s2member_sp_access

c_ws_plugin__s2member_sp_access

public class c_ws_plugin__s2member_sp_access

Specific Post/Page Access routines.

Since:

3.5


( 4 Methods )
Method Summary
public static null|bool

sp_access(int|str $sp_id, bool $read_only)

Handles Specific Post/Page Access authentication.

public static str|bool

sp_access_link_gen(str|int $sp_ids, int|str $hours, bool $shrink)

Generates Specific Post/Page Access links.

public static null

sp_access_link_via_ajax()

Generates Specific Post/Page Access links via AJAX.

public static array

sp_access_session(str $add_sp_access_value)

Handles Specific Post/Page sessions, by writing access values into a cookie.

( 4 Methods )
Method Detail

s2member\includes\classes\sp-access.inc.php at line #98

sp_access()

public static null|bool sp_access(int|str $sp_id, bool $read_only)

Handles Specific Post/Page Access authentication.

Since:

3.5

Parameters:

int|str $sp_id - Numeric Post/Page ID in WordPress®.

bool $read_only - Optional. Defaults to false. If $read_only = true, no session cookies are set, no IP Restrictions are checked, and script execution is not exited on Link failure. In other words, with $read_only = true, this function will simply return true or false.

Returns:

null|bool - Always returns true if access is indeed allowed in one way or another. If access is denied with $read_only = true simply return false. If access is denied with $read_only = false, return false; but if a Specific Post/Page Access Link is currently being used, we exit with a warning about Access Link expiration here.

[ back to top ]

s2member\includes\classes\sp-access.inc.php at line #41 public static str|bool sp_access_link_gen(str|int $sp_ids, int|str $hours, bool $shrink)

Generates Specific Post/Page Access links.

Since:

3.5

Parameters:

str|int $sp_ids - Comma-delimited list of Specific Post/Page IDs (numerical).

int|str $hours - Optional. A numeric expiration time for this link, in hours. Defaults to 72.

bool $shrink - Optional. Defaults to true. If false, the raw link will NOT be processed by the tinyURL API.

Returns:

str|bool - A Specific Post/Page Access Link, or false on failure.

[ back to top ]

s2member\includes\classes\sp-access.inc.php at line #68 public static null sp_access_link_via_ajax()

Generates Specific Post/Page Access links via AJAX.

Since:

3.5

Attaches-to:

add_action("wp_ajax_ws_plugin__s2member_sp_access_link_via_ajax");

Returns:

null - Exits script execution after returning data for AJAX caller.

[ back to top ]

s2member\includes\classes\sp-access.inc.php at line #152

sp_access_session()

public static array sp_access_session(str $add_sp_access_value)

Handles Specific Post/Page sessions, by writing access values into a cookie.

Can be used to add a new value to the session, and/or to return the current set of values in the session.

Since:

3.5

Parameters:

str $add_sp_access_value - Encrypted Specific Post/Page Access value.

Returns:

array - Array of Specific Post/Page Access values.

[ back to top ]

Source Code Documentation


Field Summary | Method Summary | Field Detail | Method Detail