_remove_qs_args_if_not_in_url example

    if ( get_query_var( 'preview' ) ) {
        $redirect['query'] = remove_query_arg( 'preview', $redirect['query'] );
    }

    $post_id = get_query_var( 'p' );

    if ( is_feed() && $post_id ) {
        $redirect_url = get_post_comments_feed_link( $post_idget_query_var( 'feed' ) );
        $redirect_obj = get_post( $post_id );

        if ( $redirect_url ) {
            $redirect['query'] = _remove_qs_args_if_not_in_url(
                $redirect['query'],
                array( 'p', 'page_id', 'attachment_id', 'pagename', 'name', 'post_type', 'feed' ),
                $redirect_url
            );

            $redirect['path'] = parse_url( $redirect_url, PHP_URL_PATH );
        }
    }

    if ( is_singular() && $wp_query->post_count < 1 && $post_id ) {

        
Home | Imprint | This part of the site doesn't use cookies.