dozent_redirect( string $location = 'back' )

Redirects to another page.


Description

IF leave $location argument, it will redirect you to back.

Example usage:

dozent_redirect();

Note: Redirect work by Location : Header, so use this function before print anything.


Parameters

$location

(string) (Optional) URL

Default value: 'back'


Source

File: includes/core-functions.php

3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
function dozent_redirect( $location = 'back' ) {
 
    if ( $location === 'back' ) {
        $location = wp_get_raw_referer();
    }
 
    if ( $location ) {
        wp_redirect( $location );
        die();
    }
}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.