Answers for "check url parameter if not redirect wordpress"

PHP
0

check url parameter if not redirect wordpress

function redirect_direct_access( ) {

    $post_id = get_the_ID();

    if ( $post_id == POST_ID && !isset( $_GET[ 'voluumdata' ] ) ) { 
        wp_redirect( 'REDIRECT_URL' );
        exit();
    }
}

add_action( 'template_redirect', 'redirect_direct_access' );
Posted by: Guest on October-02-2020

Code answers related to "check url parameter if not redirect wordpress"

Browse Popular Code Answers by Language