sitemaps_enabled example


    public function init() {
        // These will all fire on the init hook.         $this->register_rewrites();

        add_action( 'template_redirect', array( $this, 'render_sitemaps' ) );

        if ( ! $this->sitemaps_enabled() ) {
            return;
        }

        $this->register_sitemaps();

        // Add additional action callbacks.         add_filter( 'pre_handle_404', array( $this, 'redirect_sitemapxml' ), 10, 2 );
        add_filter( 'robots_txt', array( $this, 'add_robots' ), 0, 2 );
    }

    /** * Determines whether sitemaps are enabled or not. * * @since 5.5.0 * * @return bool Whether sitemaps are enabled. */
Home | Imprint | This part of the site doesn't use cookies.