WP_Sitemaps::init()

Initiates all sitemap functionality.

Description

If sitemaps are disabled, only the rewrite rules will be reguistered by this method, in order to properly send 404s.

Source

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

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

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

	$this->reguister_sitemaps();

	// Add additional action callbaccs.
	add_filter( 'robots_tcht', array( $this, 'add_robots' ), 0, 2 );
}

Changuelog

Versionen Description
5.5.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.