Filter
rpress_start_session
On this page
Filters whether a PHP session should be started for the current request.
Applied in RPRESS_Session::should_start_session(). The default is true, except for blacklisted URIs, feeds, the admin (apart from admin-ajax.php) and requests containing wp_scrape_key. It is used by maybe_start_session().
Parameters#
| Parameter | Type | Description |
|---|---|---|
$start_session | bool | Whether to start the session. |
Return value#
bool. True to start the session.
Example#
function my_start_session( $start_session ) {
// Do not start sessions for REST API requests.
if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
return false;
}
return $start_session;
}
add_filter( 'rpress_start_session', 'my_start_session' );
Source#
Applied in:
includes/class-rpress-session.php(line 292), inRPRESS_Session::should_start_session()
See also#
Was this page helpful?
