PHP Class WPCOM_Legacy_Redirector, vip-mu-plugins-public

Exibir arquivo Open project: Automattic/vip-mu-plugins-public Class Usage Examples

Public Methods

Method Description
get_redirect_post_id ( $url )
get_redirect_uri ( $url )
init ( )
insert_legacy_redirect ( string $from_url, integer | string $redirect_to ) : boolean | WP_Error
maybe_do_redirect ( )
start ( )

Private Methods

Method Description
get_url_hash ( $url )
normalise_url ( string $url ) : string Takes a request URL and "normalises" it, stripping common elements

Method Details

get_redirect_post_id() static public method

static public get_redirect_post_id ( $url )

get_redirect_uri() static public method

static public get_redirect_uri ( $url )

init() static public method

static public init ( )

insert_legacy_redirect() static public method

static public insert_legacy_redirect ( string $from_url, integer | string $redirect_to ) : boolean | WP_Error
$from_url string URL or path that should be redirected; should have leading slash if path.
$redirect_to integer | string The post ID or URL to redirect to.
return boolean | WP_Error Error if invalid redirect URL specified or if the URI already has a rule; false if not is_admin, true otherwise.

maybe_do_redirect() static public method

static public maybe_do_redirect ( )

start() static public method

static public start ( )