From a15912561ea8f5c26cb59070e88113d9a0daf4a1 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 19 Jun 2020 17:56:09 +0000 Subject: [PATCH] Docs: Document globals in `WP_Sitemaps_*` classes the same way they are documented in the rest of core. See #49572, #50117. Built from https://develop.svn.wordpress.org/trunk@48093 git-svn-id: http://core.svn.wordpress.org/trunk@47860 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/sitemaps.php | 9 ++------- wp-includes/sitemaps/class-wp-sitemaps-index.php | 3 ++- wp-includes/sitemaps/class-wp-sitemaps-provider.php | 3 ++- wp-includes/sitemaps/class-wp-sitemaps-renderer.php | 6 ++++-- wp-includes/sitemaps/class-wp-sitemaps.php | 2 ++ wp-includes/version.php | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/wp-includes/sitemaps.php b/wp-includes/sitemaps.php index 6c92763270..fcbdefe199 100644 --- a/wp-includes/sitemaps.php +++ b/wp-includes/sitemaps.php @@ -15,16 +15,11 @@ * * @since 5.5.0 * + * @global WP_Sitemaps $wp_sitemaps Global Core Sitemaps instance. + * * @return WP_Sitemaps|null Sitemaps instance, or null if sitemaps are disabled. */ function wp_sitemaps_get_server() { - /** - * Global Core Sitemaps instance. - * - * @since 5.5.0 - * - * @var WP_Sitemaps $wp_sitemaps - */ global $wp_sitemaps; $is_enabled = (bool) get_option( 'blog_public' ); diff --git a/wp-includes/sitemaps/class-wp-sitemaps-index.php b/wp-includes/sitemaps/class-wp-sitemaps-index.php index abaf9e539c..a51634b929 100644 --- a/wp-includes/sitemaps/class-wp-sitemaps-index.php +++ b/wp-includes/sitemaps/class-wp-sitemaps-index.php @@ -67,10 +67,11 @@ class WP_Sitemaps_Index { * * @since 5.5.0 * + * @global WP_Rewrite $wp_rewrite WordPress rewrite component. + * * @return string The sitemap index url. */ public function get_index_url() { - /* @var WP_Rewrite $wp_rewrite */ global $wp_rewrite; if ( ! $wp_rewrite->using_permalinks() ) { diff --git a/wp-includes/sitemaps/class-wp-sitemaps-provider.php b/wp-includes/sitemaps/class-wp-sitemaps-provider.php index 877ebd81e3..7226199f87 100644 --- a/wp-includes/sitemaps/class-wp-sitemaps-provider.php +++ b/wp-includes/sitemaps/class-wp-sitemaps-provider.php @@ -136,12 +136,13 @@ abstract class WP_Sitemaps_Provider { * * @since 5.5.0 * + * @global WP_Rewrite $wp_rewrite WordPress rewrite component. + * * @param string $name The name of the sitemap. * @param int $page The page of the sitemap. * @return string The composed URL for a sitemap entry. */ public function get_sitemap_url( $name, $page ) { - /* @var WP_Rewrite $wp_rewrite */ global $wp_rewrite; if ( ! $wp_rewrite->using_permalinks() ) { diff --git a/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/wp-includes/sitemaps/class-wp-sitemaps-renderer.php index 373a9dbdaf..29071778dd 100644 --- a/wp-includes/sitemaps/class-wp-sitemaps-renderer.php +++ b/wp-includes/sitemaps/class-wp-sitemaps-renderer.php @@ -57,10 +57,11 @@ class WP_Sitemaps_Renderer { * * @since 5.5.0 * + * @global WP_Rewrite $wp_rewrite WordPress rewrite component. + * * @return string The sitemap stylesheet url. */ public function get_sitemap_stylesheet_url() { - /* @var WP_Rewrite $wp_rewrite */ global $wp_rewrite; $sitemap_url = home_url( '/wp-sitemap.xsl' ); @@ -87,10 +88,11 @@ class WP_Sitemaps_Renderer { * * @since 5.5.0 * + * @global WP_Rewrite $wp_rewrite WordPress rewrite component. + * * @return string The sitemap index stylesheet url. */ public function get_sitemap_index_stylesheet_url() { - /* @var WP_Rewrite $wp_rewrite */ global $wp_rewrite; $sitemap_url = home_url( '/wp-sitemap-index.xsl' ); diff --git a/wp-includes/sitemaps/class-wp-sitemaps.php b/wp-includes/sitemaps/class-wp-sitemaps.php index 1e72f13d51..2ea71f9e14 100644 --- a/wp-includes/sitemaps/class-wp-sitemaps.php +++ b/wp-includes/sitemaps/class-wp-sitemaps.php @@ -139,6 +139,8 @@ class WP_Sitemaps { * Renders sitemap templates based on rewrite rules. * * @since 5.5.0 + * + * @global WP_Query $wp_query WordPress Query object. */ public function render_sitemaps() { global $wp_query; diff --git a/wp-includes/version.php b/wp-includes/version.php index 2e81913d27..a59bf19f32 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.5-alpha-48092'; +$wp_version = '5.5-alpha-48093'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.