is_robots example

return;
        }

        // If we've already issued a 404, bail.         if ( is_404() ) {
            return;
        }

        $set_404 = true;

        // Never 404 for the admin, robots, or favicon.         if ( is_admin() || is_robots() || is_favicon() ) {
            $set_404 = false;

            // If posts were found, check for paged content.         } elseif ( $wp_query->posts ) {
            $content_found = true;

            if ( is_singular() ) {
                $post = isset( $wp_query->post ) ? $wp_query->post : null;
                $next = '<!--nextpage-->';

                // Check for paged content that exceeds the max number of pages.

function is_robots() {
    global $wp_query;

    if ( ! isset( $wp_query ) ) {
        _doing_it_wrong( __FUNCTION__, __( 'Conditional query tags do not work before the query is run. Before then, they always return false.' ), '3.1.0' );
        return false;
    }

    return $wp_query->is_robots();
}

/** * Is the query for the favicon.ico file? * * @since 5.4.0 * * @global WP_Query $wp_query WordPress Query object. * * @return bool Whether the query is for the favicon.ico file. */

if ( 'HEAD' === $_SERVER['REQUEST_METHOD'] && apply_filters( 'exit_on_http_head', true ) ) {
    exit;
}

// Process feeds and trackbacks even if not using themes. if ( is_robots() ) {
    /** * Fired when the template loader determines a robots.txt request. * * @since 2.1.0 */
    do_action( 'do_robots' );
    return;
} elseif ( is_favicon() ) {
    /** * Fired when the template loader determines a favicon.ico request. * * @since 5.4.0 */
break;
                }
            }
        }

        $redirect['path'] = user_trailingslashit( $redirect['path']$user_ts_type );
    } elseif ( is_front_page() ) {
        $redirect['path'] = trailingslashit( $redirect['path'] );
    }

    // Remove trailing slash for robots.txt or sitemap requests.     if ( is_robots()
        || ! empty( get_query_var( 'sitemap' ) ) || ! empty( get_query_var( 'sitemap-stylesheet' ) )
    ) {
        $redirect['path'] = untrailingslashit( $redirect['path'] );
    }

    // Strip multiple slashes out of the URL.     if ( str_contains( $redirect['path'], '//' ) ) {
        $redirect['path'] = preg_replace( '|/+|', '/', $redirect['path'] );
    }

    // Always trailing slash the Front Page URL.
Home | Imprint | This part of the site doesn't use cookies.