PHP Class Mlp_Redirect_Frontend

ファイルを表示 Open project: inpsyde/multilingual-press Class Usage Examples

Public Methods

Method Description
__construct ( Mlp_Redirect_Response_Interface $response, string $option_name ) Constructor.
add_noredirect_parameter ( string $url, integer $site_id ) : string Adds the noredirect query var to the given URL.
is_redirectable ( ) : boolean Checks if the current request should be redirected.
setup ( ) : void Initializes the redirect data and response classes.

Method Details

__construct() public method

Constructor.
public __construct ( Mlp_Redirect_Response_Interface $response, string $option_name )
$response Mlp_Redirect_Response_Interface Redirect response object.
$option_name string Option name.

add_noredirect_parameter() public method

Adds the noredirect query var to the given URL.
public add_noredirect_parameter ( string $url, integer $site_id ) : string
$url string URL.
$site_id integer Site ID.
return string

is_redirectable() public method

Requires an accept header, the redirect feature being active for the current site, and the current language not being included in the $_SESSION's noredirect element.
public is_redirectable ( ) : boolean
return boolean

setup() public method

Initializes the redirect data and response classes.
public setup ( ) : void
return void