From 63ea8284a3e57ae289ce9ce39a4469cdc317906a Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 15 May 2021 17:38:05 +0000 Subject: [PATCH] Docs: Miscellaneous DocBlock corrections. See #52628. Built from https://develop.svn.wordpress.org/trunk@50916 git-svn-id: http://core.svn.wordpress.org/trunk@50525 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/authorize-application.php | 2 +- wp-admin/includes/class-wp-site-health.php | 8 ++++---- wp-admin/setup-config.php | 2 +- wp-includes/class-wp-simplepie-file.php | 14 +++++++------- wp-includes/feed.php | 4 ++-- wp-includes/https-detection.php | 4 ++-- wp-includes/sitemaps.php | 8 ++++++-- wp-includes/user.php | 2 +- wp-includes/version.php | 2 +- wp-load.php | 11 ++++++----- 10 files changed, 31 insertions(+), 26 deletions(-) diff --git a/wp-admin/authorize-application.php b/wp-admin/authorize-application.php index 94327b05b7..b2027250f5 100644 --- a/wp-admin/authorize-application.php +++ b/wp-admin/authorize-application.php @@ -12,7 +12,7 @@ require_once __DIR__ . '/admin.php'; $error = null; $new_password = ''; -// This is the no-js fallback script. Generally this will all be handled by `auth-app.js` +// This is the no-js fallback script. Generally this will all be handled by `auth-app.js`. if ( isset( $_POST['action'] ) && 'authorize_application_password' === $_POST['action'] ) { check_admin_referer( 'authorize_application_password' ); diff --git a/wp-admin/includes/class-wp-site-health.php b/wp-admin/includes/class-wp-site-health.php index 0d697e4566..a21045d291 100644 --- a/wp-admin/includes/class-wp-site-health.php +++ b/wp-admin/includes/class-wp-site-health.php @@ -1513,8 +1513,8 @@ class WP_Site_Health { * @return array The test results. */ public function get_test_https_status() { - // Enforce fresh HTTPS detection results. This is normally invoked by using cron, but for Site Health it should - // always rely on the latest results. + // Enforce fresh HTTPS detection results. This is normally invoked by using cron, + // but for Site Health it should always rely on the latest results. wp_update_https_detection_errors(); $default_update_url = wp_get_default_update_https_url(); @@ -1541,8 +1541,8 @@ class WP_Site_Health { ); if ( ! wp_is_using_https() ) { - // If the website is not using HTTPS, provide more information about whether it is supported and how it can - // be enabled. + // If the website is not using HTTPS, provide more information + // about whether it is supported and how it can be enabled. $result['status'] = 'recommended'; $result['label'] = __( 'Your website does not use HTTPS' ); diff --git a/wp-admin/setup-config.php b/wp-admin/setup-config.php index d72c21e2e6..55c00484ac 100644 --- a/wp-admin/setup-config.php +++ b/wp-admin/setup-config.php @@ -453,7 +453,7 @@ if ( ! /iPad|iPod|iPhone/.test( navigator.userAgent ) ) { $wp_config_perms = fileperms( $path_to_wp_config ); if ( ! empty( $wp_config_perms ) && ! is_writable( $path_to_wp_config ) ) { $error_message = sprintf( - /* translators: 1 wp-config.php, 2: Documentation URL. */ + /* translators: 1: wp-config.php, 2: Documentation URL. */ __( 'You need to make the file %1$s writable before you can save your changes. See Changing File Permissions for more information.' ), 'wp-config.php', __( 'https://wordpress.org/support/article/changing-file-permissions/' ) diff --git a/wp-includes/class-wp-simplepie-file.php b/wp-includes/class-wp-simplepie-file.php index beb40efbcd..1c2630ae6c 100644 --- a/wp-includes/class-wp-simplepie-file.php +++ b/wp-includes/class-wp-simplepie-file.php @@ -24,8 +24,8 @@ class WP_SimplePie_File extends SimplePie_File { * * @since 2.8.0 * @since 3.2.0 Updated to use a PHP5 constructor. - * @since 5.6.1 Multiple headers are concatenated into a comma-separated string, rather than remaining - * an array. + * @since 5.6.1 Multiple headers are concatenated into a comma-separated string, + * rather than remaining an array. * * @param string $url Remote file URL. * @param int $timeout Optional. How long the connection should stay open in seconds. @@ -70,12 +70,12 @@ class WP_SimplePie_File extends SimplePie_File { $this->headers = wp_remote_retrieve_headers( $res ); /* - * SimplePie expects multiple headers to be stored as a comma-separated string, but - * `wp_remote_retrieve_headers()` returns them as an array, so they need to be - * converted. + * SimplePie expects multiple headers to be stored as a comma-separated string, + * but `wp_remote_retrieve_headers()` returns them as an array, so they need + * to be converted. * - * The only exception to that is the `content-type` header, which should ignore any - * previous values and only use the last one. + * The only exception to that is the `content-type` header, which should ignore + * any previous values and only use the last one. * * @see SimplePie_HTTP_Parser::new_line(). */ diff --git a/wp-includes/feed.php b/wp-includes/feed.php index 265a9a45b2..9e23dad934 100644 --- a/wp-includes/feed.php +++ b/wp-includes/feed.php @@ -796,8 +796,8 @@ function fetch_feed( $url ) { $feed = new SimplePie(); $feed->set_sanitize_class( 'WP_SimplePie_Sanitize_KSES' ); - // We must manually overwrite $feed->sanitize because SimplePie's - // constructor sets it before we have a chance to set the sanitization class. + // We must manually overwrite $feed->sanitize because SimplePie's constructor + // sets it before we have a chance to set the sanitization class. $feed->sanitize = new WP_SimplePie_Sanitize_KSES(); // Register the cache handler using the recommended method for SimplePie 1.3 or later. diff --git a/wp-includes/https-detection.php b/wp-includes/https-detection.php index f834549f95..485bffeb00 100644 --- a/wp-includes/https-detection.php +++ b/wp-includes/https-detection.php @@ -40,8 +40,8 @@ function wp_is_home_url_using_https() { /** * Checks whether the current site's URL where WordPress is stored is using HTTPS. * - * This checks the URL where WordPress application files (e.g. wp-blog-header.php or the wp-admin/ folder) are - * accessible. + * This checks the URL where WordPress application files (e.g. wp-blog-header.php or the wp-admin/ folder) + * are accessible. * * @since 5.7.0 * @see site_url() diff --git a/wp-includes/sitemaps.php b/wp-includes/sitemaps.php index 1dfcd1d69c..656fc5ecaa 100644 --- a/wp-includes/sitemaps.php +++ b/wp-includes/sitemaps.php @@ -51,6 +51,7 @@ function wp_sitemaps_get_server() { */ function wp_get_sitemap_providers() { $sitemaps = wp_sitemaps_get_server(); + return $sitemaps->registry->get_providers(); } @@ -65,6 +66,7 @@ function wp_get_sitemap_providers() { */ function wp_register_sitemap_provider( $name, WP_Sitemaps_Provider $provider ) { $sitemaps = wp_sitemaps_get_server(); + return $sitemaps->registry->add_provider( $name, $provider ); } @@ -94,12 +96,13 @@ function wp_sitemaps_get_max_urls( $object_type ) { * @since 5.5.1 * * @param string $name The sitemap name. - * @param string $subtype_name The sitemap subtype name. Default empty string. - * @param int $page The page of the sitemap. Default 1. + * @param string $subtype_name The sitemap subtype name. Default empty string. + * @param int $page The page of the sitemap. Default 1. * @return string|false The sitemap URL or false if the sitemap doesn't exist. */ function get_sitemap_url( $name, $subtype_name = '', $page = 1 ) { $sitemaps = wp_sitemaps_get_server(); + if ( ! $sitemaps ) { return false; } @@ -121,5 +124,6 @@ function get_sitemap_url( $name, $subtype_name = '', $page = 1 ) { if ( 0 >= $page ) { $page = 1; } + return $provider->get_sitemap_url( $subtype_name, $page ); } diff --git a/wp-includes/user.php b/wp-includes/user.php index 8a94526df2..13c1542e86 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -747,7 +747,7 @@ function delete_user_option( $user_id, $option_name, $global = false ) { * * @see WP_User_Query * - * @param array $args Optional. Arguments to retrieve users. See WP_User_Query::prepare_query(). + * @param array $args Optional. Arguments to retrieve users. See WP_User_Query::prepare_query() * for more information on accepted arguments. * @return array List of users. */ diff --git a/wp-includes/version.php b/wp-includes/version.php index b25c16ff6e..8f6871f361 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.8-alpha-50915'; +$wp_version = '5.8-alpha-50916'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-load.php b/wp-load.php index 622865959e..2c20055f15 100644 --- a/wp-load.php +++ b/wp-load.php @@ -25,13 +25,14 @@ if ( ! defined( 'ABSPATH' ) ) { * The error_reporting() function can be disabled in php.ini. On systems where that is the case, * it's best to add a dummy function to the wp-config.php file, but as this call to the function * is run prior to wp-config.php loading, it is wrapped in a function_exists() check. - * - * Initialize error reporting to a known set of levels. - * - * This will be adapted in wp_debug_mode located in wp-includes/load.php based on WP_DEBUG. - * @see http://php.net/manual/en/errorfunc.constants.php List of known error levels. */ if ( function_exists( 'error_reporting' ) ) { + /* + * Initialize error reporting to a known set of levels. + * + * This will be adapted in wp_debug_mode() located in wp-includes/load.php based on WP_DEBUG. + * @see http://php.net/manual/en/errorfunc.constants.php List of known error levels. + */ error_reporting( E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_ERROR | E_WARNING | E_PARSE | E_USER_ERROR | E_USER_WARNING | E_RECOVERABLE_ERROR ); }