Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

check url parameter if not redirect wordpress plugin

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' );
 
PREVIOUS NEXT
Tagged: #check #url #parameter #redirect #wordpress #plugin
ADD COMMENT
Topic
Name
3+2 =