WP_Sitemaps::sitemaps_enabled(): bool

Determines whether sitemaps are enabled or not.


Return

bool Whether sitemaps are enabled.


Top ↑

Source

File: wp-includes/sitemaps/class-wp-sitemaps.php. View all references

public function sitemaps_enabled() {
	$is_enabled = (bool) get_option( 'blog_public' );

	/**
	 * Filters whether XML Sitemaps are enabled or not.
	 *
	 * When XML Sitemaps are disabled via this filter, rewrite rules are still
	 * in place to ensure a 404 is returned.
	 *
	 * @see WP_Sitemaps::register_rewrites()
	 *
	 * @since 5.5.0
	 *
	 * @param bool $is_enabled Whether XML Sitemaps are enabled or not.
	 *                         Defaults to true for public sites.
	 */
	return (bool) apply_filters( 'wp_sitemaps_enabled', $is_enabled );
}

Top ↑

Hooks



Top ↑

Changelog

Changelog
Version Description
5.5.0 Introduced.

Top ↑

User Contributed Notes

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