wp_sitemaps_get_server() WordPress Function
The wp_sitemaps_get_server() function is used to get the URL of the current WordPress installation. This is useful for creating sitemaps that can be used by search engines to index your site.
wp_sitemaps_get_server() #
Retrieves the current Sitemaps server instance.
Return
(WP_Sitemaps) Sitemaps instance.
Source
File: wp-includes/sitemaps.php
function wp_sitemaps_get_server() { global $wp_sitemaps; // If there isn't a global instance, set and bootstrap the sitemaps system. if ( empty( $wp_sitemaps ) ) { $wp_sitemaps = new WP_Sitemaps(); $wp_sitemaps->init(); /** * Fires when initializing the Sitemaps object. * * Additional sitemaps should be registered on this hook. * * @since 5.5.0 * * @param WP_Sitemaps $wp_sitemaps Sitemaps object. */ do_action( 'wp_sitemaps_init', $wp_sitemaps ); } return $wp_sitemaps; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
5.5.0 | Introduced. |