Docs: Further corrections and improvements to various inline docblocks.

See #49572

git-svn-id: https://develop.svn.wordpress.org/trunk@48576 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2020-07-23 07:37:57 +00:00
parent cefe2c7f7c
commit 7d4c77560c
18 changed files with 85 additions and 83 deletions

View File

@ -159,17 +159,17 @@ class WP_Site_Health {
* @param array $test_result {
* An associative array of test result data.
*
* @param string $label A label describing the test, and is used as a header in the output.
* @param string $status The status of the test, which can be a value of `good`, `recommended` or `critical`.
* @param array $badge {
* @type string $label A label describing the test, and is used as a header in the output.
* @type string $status The status of the test, which can be a value of `good`, `recommended` or `critical`.
* @type array $badge {
* Tests are put into categories which have an associated badge shown, these can be modified and assigned here.
*
* @param string $label The test label, for example `Performance`.
* @param string $color Default `blue`. A string representing a color to use for the label.
* @type string $label The test label, for example `Performance`.
* @type string $color Default `blue`. A string representing a color to use for the label.
* }
* @param string $description A more descriptive explanation of what the test looks for, and why it is important for the end user.
* @param string $actions An action to direct the user to where they can resolve the issue, if one exists.
* @param string $test The name of the test being ran, used as a reference point.
* @type string $description A more descriptive explanation of what the test looks for, and why it is important for the end user.
* @type string $actions An action to direct the user to where they can resolve the issue, if one exists.
* @type string $test The name of the test being ran, used as a reference point.
* }
*/
return apply_filters( 'site_status_test_result', call_user_func( $callback ) );
@ -953,18 +953,18 @@ class WP_Site_Health {
* @since 5.3.0 The `$constant` and `$class` parameters were added.
*
* @param array $modules {
* An associated array of modules to test for.
* An associative array of modules to test for.
*
* array $module {
* An associated array of module properties used during testing.
* @type array ...$0 {
* An associative array of module properties used during testing.
* One of either `$function` or `$extension` must be provided, or they will fail by default.
*
* string $function Optional. A function name to test for the existence of.
* string $extension Optional. An extension to check if is loaded in PHP.
* string $constant Optional. A constant name to check for to verify an extension exists.
* string $class Optional. A class name to check for to verify an extension exists.
* bool $required Is this a required feature or not.
* string $fallback_for Optional. The module this module replaces as a fallback.
* @type string $function Optional. A function name to test for the existence of.
* @type string $extension Optional. An extension to check if is loaded in PHP.
* @type string $constant Optional. A constant name to check for to verify an extension exists.
* @type string $class Optional. A class name to check for to verify an extension exists.
* @type bool $required Is this a required feature or not.
* @type string $fallback_for Optional. The module this module replaces as a fallback.
* }
* }
*/
@ -2342,7 +2342,9 @@ class WP_Site_Health {
* @return object The test results.
*/
function detect_plugin_theme_auto_update_issues() {
/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
$test_plugins_enabled = apply_filters( 'auto_update_plugin', true );
/** This filter is documented in wp-admin/includes/class-wp-automatic-updater.php */
$test_themes_enabled = apply_filters( 'auto_update_theme', true );
$ui_enabled_for_plugins = wp_is_auto_update_enabled_for_type( 'plugin' );
$ui_enabled_for_themes = wp_is_auto_update_enabled_for_type( 'theme' );

View File

@ -21,7 +21,7 @@
* @param string $comment_author Author of the comment.
* @param string $comment_date Date of the comment.
* @param string $timezone Timezone. Accepts 'blog' or 'gmt'. Default 'blog'.
* @return mixed Comment post ID on success.
* @return string|null Comment post ID on success.
*/
function comment_exists( $comment_author, $comment_date, $timezone = 'blog' ) {
global $wpdb;

View File

@ -1542,7 +1542,7 @@ function do_accordion_sections( $screen, $context, $object ) {
*
* @since 2.7.0
*
* @global $wp_settings_sections Storage array of all settings sections added to admin pages.
* @global array $wp_settings_sections Storage array of all settings sections added to admin pages.
*
* @param string $id Slug-name to identify the section. Used in the 'id' attribute of tags.
* @param string $title Formatted title of the section. Shown as the heading for the section.
@ -1601,7 +1601,7 @@ function add_settings_section( $id, $title, $callback, $page ) {
* @since 2.7.0
* @since 4.2.0 The `$class` argument was added.
*
* @global $wp_settings_fields Storage array of settings fields and info about their pages/sections.
* @global array $wp_settings_fields Storage array of settings fields and info about their pages/sections.
*
* @param string $id Slug-name to identify the field. Used in the 'id' attribute of tags.
* @param string $title Formatted title of the field. Shown as the label for the field
@ -1666,8 +1666,8 @@ function add_settings_field( $id, $title, $callback, $page, $section = 'default'
* to output all the sections and fields that were added to that $page with
* add_settings_section() and add_settings_field()
*
* @global $wp_settings_sections Storage array of all settings sections added to admin pages.
* @global $wp_settings_fields Storage array of settings fields and info about their pages/sections.
* @global array $wp_settings_sections Storage array of all settings sections added to admin pages.
* @global array $wp_settings_fields Storage array of settings fields and info about their pages/sections.
* @since 2.7.0
*
* @param string $page The slug name of the page whose settings sections you want to output.
@ -1704,7 +1704,7 @@ function do_settings_sections( $page ) {
* a specific section. Should normally be called by do_settings_sections()
* rather than directly.
*
* @global $wp_settings_fields Storage array of settings fields and their pages/sections.
* @global array $wp_settings_fields Storage array of settings fields and their pages/sections.
*
* @since 2.7.0
*

View File

@ -15,7 +15,7 @@
*
* @since 1.5.0
*
* @global object $authordata The current author's DB object.
* @global WP_User $authordata The current author's data.
*
* @param string $deprecated Deprecated.
* @return string|null The author's display name.
@ -32,7 +32,7 @@ function get_the_author( $deprecated = '' ) {
*
* @since 2.9.0
*
* @param string $authordata->display_name The author's display name.
* @param string|null $display_name The author's display name.
*/
return apply_filters( 'the_author', is_object( $authordata ) ? $authordata->display_name : null );
}
@ -99,7 +99,7 @@ function get_the_modified_author() {
*
* @since 2.8.0
*
* @param string $last_user->display_name The author's display name.
* @param string $display_name The author's display name.
*/
return apply_filters( 'the_modified_author', $last_user->display_name );
}
@ -152,7 +152,7 @@ function the_modified_author() {
*
* @since 2.8.0
*
* @global object $authordata The current author's DB object.
* @global WP_User $authordata The current author's data.
*
* @param string $field Optional. The user field to retrieve. Default empty.
* @param int|false $user_id Optional. User ID.
@ -287,7 +287,7 @@ function the_author_posts() {
*
* @since 4.4.0
*
* @global object $authordata The current author's DB object.
* @global WP_User $authordata The current author's data.
*
* @return string An HTML link to the author page, or an empty string if $authordata isn't defined.
*/

View File

@ -28,7 +28,7 @@ class WP_Comment_Query {
* Metadata query container
*
* @since 3.5.0
* @var object WP_Meta_Query
* @var WP_Meta_Query A meta query instance.
*/
public $meta_query = false;
@ -69,7 +69,7 @@ class WP_Comment_Query {
* Date query container
*
* @since 3.7.0
* @var object WP_Date_Query
* @var WP_Date_Query A date query instance.
*/
public $date_query = false;

View File

@ -4689,9 +4689,9 @@ final class WP_Customize_Manager {
* @param array $autofocus {
* Mapping of 'panel', 'section', 'control' to the ID which should be autofocused.
*
* @type string [$control] ID for control to be autofocused.
* @type string [$section] ID for section to be autofocused.
* @type string [$panel] ID for panel to be autofocused.
* @type string $control ID for control to be autofocused.
* @type string $section ID for section to be autofocused.
* @type string $panel ID for panel to be autofocused.
* }
*/
public function set_autofocus( $autofocus ) {
@ -4706,9 +4706,9 @@ final class WP_Customize_Manager {
* @return array {
* Mapping of 'panel', 'section', 'control' to the ID which should be autofocused.
*
* @type string [$control] ID for control to be autofocused.
* @type string [$section] ID for section to be autofocused.
* @type string [$panel] ID for panel to be autofocused.
* @type string $control ID for control to be autofocused.
* @type string $section ID for section to be autofocused.
* @type string $panel ID for panel to be autofocused.
* }
*/
public function get_autofocus() {

View File

@ -565,7 +565,7 @@ final class WP_Customize_Widgets {
*
* @since 3.9.0
*
* @global $wp_registered_widget_controls
* @global array $wp_registered_widget_controls
*
* @param string $widget_id Widget ID.
* @return bool Whether or not the widget is a "wide" widget.

View File

@ -453,6 +453,8 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
$perms = $stat['mode'] & 0000666; // Same permissions as parent folder, strip off the executable bits.
chmod( $filename, $perms );
return array(
'path' => $filename,
/**
* Filters the name of the saved image file.
*
@ -460,8 +462,6 @@ class WP_Image_Editor_GD extends WP_Image_Editor {
*
* @param string $filename Name of the file.
*/
return array(
'path' => $filename,
'file' => wp_basename( apply_filters( 'image_make_intermediate_size', $filename ) ),
'width' => $this->size['width'],
'height' => $this->size['height'],

View File

@ -37,7 +37,7 @@ class WP_Query {
* Taxonomy query, as passed to get_tax_sql()
*
* @since 3.1.0
* @var object WP_Tax_Query
* @var WP_Tax_Query A taxonomy query instance.
*/
public $tax_query;
@ -45,7 +45,7 @@ class WP_Query {
* Metadata query container
*
* @since 3.2.0
* @var object WP_Meta_Query
* @var WP_Meta_Query A meta query instance.
*/
public $meta_query = false;
@ -53,7 +53,7 @@ class WP_Query {
* Date query container
*
* @since 3.7.0
* @var object WP_Date_Query
* @var WP_Date_Query A date query instance.
*/
public $date_query = false;

View File

@ -59,7 +59,7 @@ class WP_Site_Query {
* Date query container.
*
* @since 4.6.0
* @var object WP_Date_Query
* @var WP_Date_Query A date query instance.
*/
public $date_query = false;

View File

@ -29,7 +29,7 @@ class WP_Term_Query {
* Metadata query container.
*
* @since 4.6.0
* @var object WP_Meta_Query
* @var WP_Meta_Query A meta query instance.
*/
public $meta_query = false;

View File

@ -1005,7 +1005,7 @@ function separate_comments( &$comments ) {
*
* @global WP_Query $wp_query WordPress Query object.
*
* @param WP_Comment[] $comments Optional. Array of WP_Comment objects. Defaults to $wp_query->comments.
* @param WP_Comment[] $comments Optional. Array of WP_Comment objects. Defaults to `$wp_query->comments`.
* @param int $per_page Optional. Comments per page.
* @param bool $threaded Optional. Control over flat or threaded comments.
* @return int Number of comment pages.

View File

@ -492,8 +492,8 @@ class WP_REST_Server {
* @return array {
* Data with sub-requests embedded.
*
* @type array [$_links] Links.
* @type array [$_embedded] Embeddeds.
* @type array $_links Links.
* @type array $_embedded Embeddeds.
* }
*/
public function response_to_data( $response, $embed ) {
@ -616,8 +616,8 @@ class WP_REST_Server {
* @return array {
* Data with sub-requests embedded.
*
* @type array [$_links] Links.
* @type array [$_embedded] Embeddeds.
* @type array $_links Links.
* @type array $_embedded Embeddeds.
* }
*/
protected function embed_links( $data, $embed = true ) {

View File

@ -3019,7 +3019,7 @@ function require_if_theme_supports( $feature, $include ) {
*
* @see add_theme_support()
*
* @global $_wp_registered_theme_features
* @global array $_wp_registered_theme_features
*
* @param string $feature The name uniquely identifying the feature. See add_theme_support()
* for the list of possible values.
@ -3156,7 +3156,7 @@ function register_theme_feature( $feature, $args = array() ) {
*
* @since 5.5.0
*
* @global $_wp_registered_theme_features
* @global array $_wp_registered_theme_features
*
* @return array[] List of theme features, keyed by their name.
*/
@ -3175,7 +3175,7 @@ function get_registered_theme_features() {
*
* @since 5.5.0
*
* @global $_wp_registered_theme_features
* @global array $_wp_registered_theme_features
*
* @param string $feature The feature name. See add_theme_support() for the list
* of possible values.

View File

@ -152,7 +152,7 @@ class Test_WP_Community_Events extends WP_UnitTestCase {
}
/**
* Test: With a valid response, get_events() should return an associated array containing a location array and
* Test: With a valid response, get_events() should return an associative array containing a location array and
* an events array with individual events that have formatted time and date.
*
* @since 4.8.0