Docs: Various corrections and improvements relating to types used in inline documentation.

See #53399

Built from https://develop.svn.wordpress.org/trunk@52204


git-svn-id: http://core.svn.wordpress.org/trunk@51796 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
John Blackbourn 2021-11-18 13:50:05 +00:00
parent b3b8d6959c
commit c9746ab584
28 changed files with 91 additions and 84 deletions

View File

@ -282,9 +282,9 @@ class Theme_Installer_Skin extends WP_Upgrader_Skin {
*
* @since 5.5.0
*
* @param string $table The output table with Name, Version, Author, RequiresWP, and RequiresPHP info.
* @param array $current_theme_data Array with current theme data.
* @param array $new_theme_data Array with uploaded theme data.
* @param string $table The output table with Name, Version, Author, RequiresWP, and RequiresPHP info.
* @param WP_Theme $current_theme_data Current theme data.
* @param array $new_theme_data Array with uploaded theme data.
*/
echo apply_filters( 'install_theme_overwrite_comparison', $table, $current_theme_data, $new_theme_data );

View File

@ -242,11 +242,11 @@ class Walker_Nav_Menu_Edit extends Walker_Nav_Menu {
*
* @since 5.4.0
*
* @param int $item_id Menu item ID.
* @param WP_Post $menu_item Menu item data object.
* @param int $depth Depth of menu item. Used for padding.
* @param stdClass $args An object of menu item arguments.
* @param int $current_object_id Nav menu ID.
* @param string $item_id Menu item ID as a numeric string.
* @param WP_Post $menu_item Menu item data object.
* @param int $depth Depth of menu item. Used for padding.
* @param stdClass|null $args An object of menu item arguments.
* @param int $current_object_id Nav menu ID.
*/
do_action( 'wp_nav_menu_item_custom_fields', $item_id, $menu_item, $depth, $args, $current_object_id );
?>

View File

@ -251,7 +251,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
*
* @global array $themes_allowedtags
*
* @param object $theme {
* @param stdClass $theme {
* An object that contains theme data returned by the WordPress.org API.
*
* @type string $name Theme name, e.g. 'Twenty Twenty-One'.
@ -352,7 +352,8 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
*
* @param string[] $actions An array of theme action links. Defaults are
* links to Install Now, Preview, and Details.
* @param WP_Theme $theme Theme object.
* @param stdClass $theme An object that contains theme data returned by the
* WordPress.org API.
*/
$actions = apply_filters( 'theme_install_actions', $actions, $theme );
@ -412,7 +413,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
* Prints the wrapper for the theme installer with a provided theme's data.
* Used to make the theme installer work for no-js.
*
* @param object $theme - A WordPress.org Theme API object.
* @param stdClass $theme A WordPress.org Theme API object.
*/
public function theme_installer_single( $theme ) {
?>
@ -432,7 +433,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
*
* @global array $themes_allowedtags
*
* @param object $theme - A WordPress.org Theme API object.
* @param stdClass $theme A WordPress.org Theme API object.
*/
public function install_theme_info( $theme ) {
global $themes_allowedtags;
@ -546,7 +547,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
*
* @since 3.4.0
*
* @param object $theme - A WordPress.org Theme API object.
* @param stdClass $theme A WordPress.org Theme API object.
* @return string Theme status.
*/
private function _get_theme_status( $theme ) {

View File

@ -405,7 +405,7 @@ class WP_Upgrader {
* @global WP_Filesystem_Base $wp_filesystem WordPress filesystem subclass.
*
* @param string $remote_destination The location on the remote filesystem to be cleared.
* @return bool|WP_Error True upon success, WP_Error on failure.
* @return true|WP_Error True upon success, WP_Error on failure.
*/
public function clear_destination( $remote_destination ) {
global $wp_filesystem;

View File

@ -1727,8 +1727,9 @@ function wp_dashboard_browser_nag() {
*
* @since 3.2.0
*
* @param string $notice The notice content.
* @param array $response An array containing web browser information. See `wp_check_browser_version()`.
* @param string $notice The notice content.
* @param array|false $response An array containing web browser information, or
* false on failure. See `wp_check_browser_version()`.
*/
echo apply_filters( 'browse-happy-notice', $notice, $response ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores
}

View File

@ -3641,7 +3641,7 @@ function wp_read_video_metadata( $file ) {
* @param array $metadata Filtered Video metadata.
* @param string $file Path to video file.
* @param string $file_format File format of video, as analyzed by getID3.
* @param string $data Raw metadata from getID3.
* @param array $data Raw metadata from getID3.
*/
return apply_filters( 'wp_read_video_metadata', $metadata, $file, $file_format, $data );
}

View File

@ -984,8 +984,8 @@ function page_attributes_meta_box( $post ) {
*
* @since 4.4.0
*
* @param string $template The template used for the current post.
* @param WP_Post $post The current post.
* @param string|false $template The template used for the current post.
* @param WP_Post $post The current post.
*/
do_action( 'page_attributes_meta_box_template', $template, $post );
?>

View File

@ -96,8 +96,8 @@ function wp_terms_checklist( $post_id = 0, $args = array() ) {
*
* @see wp_terms_checklist()
*
* @param array $args An array of arguments.
* @param int $post_id The post ID.
* @param array|string $args An array or string of arguments.
* @param int $post_id The post ID.
*/
$params = apply_filters( 'wp_terms_checklist_args', $args, $post_id );

View File

@ -622,10 +622,10 @@ function themes_api( $action, $args = array() ) {
*
* @since 2.8.0
*
* @param array|object|WP_Error $res WordPress.org Themes API response.
* @param string $action Requested action. Likely values are 'theme_information',
* 'feature_list', or 'query_themes'.
* @param object $args Arguments used to query for installer pages from the WordPress.org Themes API.
* @param array|stdClass|WP_Error $res WordPress.org Themes API response.
* @param string $action Requested action. Likely values are 'theme_information',
* 'feature_list', or 'query_themes'.
* @param stdClass $args Arguments used to query for installer pages from the WordPress.org Themes API.
*/
return apply_filters( 'themes_api_result', $res, $action, $args );
}

View File

@ -25,7 +25,7 @@ function add_user() {
* @since 2.0.0
*
* @param int $user_id Optional. User ID.
* @return int|WP_Error User ID of the updated user.
* @return int|WP_Error User ID of the updated user or WP_Error on failure.
*/
function edit_user( $user_id = 0 ) {
$wp_roles = wp_roles();
@ -234,9 +234,9 @@ function edit_user( $user_id = 0 ) {
*
* @since 4.4.0
*
* @param int $user_id ID of the newly created user.
* @param string $notify Type of notification that should happen. See wp_send_new_user_notifications()
* for more information on possible values.
* @param int|WP_Error $user_id ID of the newly created user or WP_Error on failure.
* @param string $notify Type of notification that should happen. See
* wp_send_new_user_notifications() for more information.
*/
do_action( 'edit_user_created_user', $user_id, $notify );
}

View File

@ -661,9 +661,9 @@ function wp_list_categories( $args = '' ) {
*
* @since 2.1.0
*
* @param string $output HTML output.
* @param array $args An array of taxonomy-listing arguments. See wp_list_categories()
* for information on accepted arguments.
* @param string $output HTML output.
* @param array|string $args An array or query string of taxonomy-listing arguments. See
* wp_list_categories() for information on accepted arguments.
*/
$html = apply_filters( 'wp_list_categories', $output, $args );

View File

@ -5923,7 +5923,7 @@ final class WP_Customize_Manager {
* @see themes_api()
* @see WP_Customize_Manager::__construct()
*
* @param array $themes Nested array of theme data.
* @param array|stdClass $themes Nested array or object of theme data.
* @param array $args List of arguments, such as page, search term, and tags to query for.
* @param WP_Customize_Manager $manager Instance of Customize manager.
*/

View File

@ -1213,8 +1213,8 @@ final class WP_Theme implements ArrayAccess {
* @since 4.7.0
* @since 5.8.0 Include block templates.
*
* @return string[] Array of page templates, keyed by filename and post type,
* with the value of the translated header name.
* @return array[] Array of page template arrays, keyed by post type and filename,
* with the value of the translated header name.
*/
public function get_post_templates() {
// If you screw up your current theme and we invalidate your parent, most things still work. Let it slide.

View File

@ -8134,13 +8134,13 @@ function get_dirsize( $directory, $max_execution_time = null ) {
* @since 5.2.0 The `$max_execution_time` parameter was added.
* @since 5.6.0 The `$directory_cache` parameter was added.
*
* @param string $directory Full path of a directory.
* @param string|array $exclude Optional. Full path of a subdirectory to exclude from the total,
* or array of paths. Expected without trailing slash(es).
* @param int $max_execution_time Optional. Maximum time to run before giving up. In seconds.
* The timeout is global and is measured from the moment
* WordPress started to load.
* @param array $directory_cache Optional. Array of cached directory paths.
* @param string $directory Full path of a directory.
* @param string|string[] $exclude Optional. Full path of a subdirectory to exclude from the total,
* or array of paths. Expected without trailing slash(es).
* @param int $max_execution_time Optional. Maximum time to run before giving up. In seconds.
* The timeout is global and is measured from the moment
* WordPress started to load.
* @param array $directory_cache Optional. Array of cached directory paths.
*
* @return int|false|null Size in bytes if a valid directory. False if not. Null if timeout.
*/
@ -8191,7 +8191,12 @@ function recurse_dirsize( $directory, $exclude = null, $max_execution_time = nul
*
* @since 5.6.0
*
* @param int|false $space_used The amount of used space, in bytes. Default false.
* @param int|false $space_used The amount of used space, in bytes. Default false.
* @param string $directory Full path of a directory.
* @param string|string[]|null $exclude Full path of a subdirectory to exclude from the total,
* or array of paths.
* @param int $max_execution_time Maximum time to run before giving up. In seconds.
* @param array $directory_cache Array of cached directory paths.
*/
$size = apply_filters( 'pre_recurse_dirsize', false, $directory, $exclude, $max_execution_time, $directory_cache );

View File

@ -1271,7 +1271,7 @@ function wpmu_activate_signup( $key ) {
*
* @param int $blog_id Blog ID.
* @param int $user_id User ID.
* @param int $password User password.
* @param string $password User password.
* @param string $signup_title Site title.
* @param array $meta Signup meta data. By default, contains the requested privacy setting and lang_id.
*/

View File

@ -1005,9 +1005,9 @@ function wp_link_pages( $args = '' ) {
*
* @since 3.6.0
*
* @param string $output HTML output of paginated posts' page links.
* @param array $args An array of arguments. See wp_link_pages()
* for information on accepted arguments.
* @param string $output HTML output of paginated posts' page links.
* @param array|string $args An array or query string of arguments. See wp_link_pages()
* for information on accepted arguments.
*/
$html = apply_filters( 'wp_link_pages', $output, $args );
@ -1646,7 +1646,7 @@ function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = fals
* @since 5.1.0 Added the `$attr` parameter.
*
* @param string $link_html The page link HTML output.
* @param int $id Post ID.
* @param int|WP_Post $id Post ID or object. Can be 0 for the current global post.
* @param string|int[] $size Requested image size. Can be any registered image size name, or
* an array of width and height values in pixels (in that order).
* @param bool $permalink Whether to add permalink to image. Default false.

View File

@ -224,10 +224,10 @@ function get_the_post_thumbnail( $post = null, $size = 'post-thumbnail', $attr =
*
* @param string $html The post thumbnail HTML.
* @param int $post_id The post ID.
* @param int $post_thumbnail_id The post thumbnail ID.
* @param int $post_thumbnail_id The post thumbnail ID, or 0 if there isn't one.
* @param string|int[] $size Requested image size. Can be any registered image size name, or
* an array of width and height values in pixels (in that order).
* @param string $attr Query string of attributes.
* @param string|array $attr Query string or array of attributes.
*/
return apply_filters( 'post_thumbnail_html', $html, $post->ID, $post_thumbnail_id, $size, $attr );
}

View File

@ -1397,11 +1397,11 @@ class WP_REST_Server {
}
/**
* Filters the REST API endpoint data.
* Filters the publicly-visible data for a single REST API route.
*
* @since 4.4.0
*
* @param WP_REST_Request $request Request data. The namespace is passed as the 'namespace' parameter.
* @param array $data Publicly-visible data for the route.
*/
$available[ $route ] = apply_filters( 'rest_endpoints_description', $data );
}

View File

@ -211,7 +211,7 @@ class WP_REST_Block_Navigation_Areas_Controller extends WP_REST_Controller {
*
* @param stdClass $area Post status data.
* @param WP_REST_Request $request Full details about the request.
* @return WP_REST_Response Post status data.
* @return WP_REST_Response|WP_Error Response object on success, or WP_Error object on failure.
*/
public function prepare_item_for_response( $area, $request ) {
$areas = get_navigation_areas();
@ -246,9 +246,9 @@ class WP_REST_Block_Navigation_Areas_Controller extends WP_REST_Controller {
* Allows modification of the navigation area data right before it is
* returned.
*
* @param WP_REST_Response $response The response object.
* @param object $area The original status object.
* @param WP_REST_Request $request Request used to generate the response.
* @param WP_REST_Response\WP_Error $response The response object, or WP_Error object on failure.
* @param object $area The original status object.
* @param WP_REST_Request $request Request used to generate the response.
*/
return apply_filters( 'rest_prepare_navigation_area', $response, $area, $request );
}

View File

@ -460,10 +460,10 @@ class WP_REST_Widgets_Controller extends WP_REST_Controller {
*
* @since 5.8.0
*
* @param string $widget_id ID of the widget marked for deletion.
* @param string $sidebar_id ID of the sidebar the widget was deleted from.
* @param WP_REST_Response $response The response data.
* @param WP_REST_Request $request The request sent to the API.
* @param string $widget_id ID of the widget marked for deletion.
* @param string $sidebar_id ID of the sidebar the widget was deleted from.
* @param WP_REST_Response|WP_Error $response The response data, or WP_Error object on failure.
* @param WP_REST_Request $request The request sent to the API.
*/
do_action( 'rest_delete_widget', $widget_id, $sidebar_id, $response, $request );
@ -733,9 +733,9 @@ class WP_REST_Widgets_Controller extends WP_REST_Controller {
*
* @since 5.8.0
*
* @param WP_REST_Response $response The response object.
* @param array $widget The registered widget data.
* @param WP_REST_Request $request Request used to generate the response.
* @param WP_REST_Response|WP_Error $response The response object, or WP_Error object on failure.
* @param array $widget The registered widget data.
* @param WP_REST_Request $request Request used to generate the response.
*/
return apply_filters( 'rest_prepare_widget', $response, $widget, $request );
}

View File

@ -42,7 +42,7 @@ abstract class WP_Sitemaps_Provider {
*
* @param int $page_num Page of results.
* @param string $object_subtype Optional. Object subtype name. Default empty.
* @return array Array of URLs for a sitemap.
* @return array[] Array of URL information for a sitemap.
*/
abstract public function get_url_list( $page_num, $object_subtype = '' );

View File

@ -59,7 +59,7 @@ class WP_Sitemaps_Posts extends WP_Sitemaps_Provider {
* @param int $page_num Page of results.
* @param string $object_subtype Optional. Post type name. Default empty.
*
* @return array Array of URLs for a sitemap.
* @return array[] Array of URL information for a sitemap.
*/
public function get_url_list( $page_num, $object_subtype = '' ) {
// Restores the more descriptive, specific name for use within this method.
@ -80,9 +80,9 @@ class WP_Sitemaps_Posts extends WP_Sitemaps_Provider {
*
* @since 5.5.0
*
* @param array $url_list The URL list. Default null.
* @param string $post_type Post type name.
* @param int $page_num Page of results.
* @param array[]|null $url_list The URL list. Default null.
* @param string $post_type Post type name.
* @param int $page_num Page of results.
*/
$url_list = apply_filters(
'wp_sitemaps_posts_pre_url_list',

View File

@ -56,7 +56,7 @@ class WP_Sitemaps_Taxonomies extends WP_Sitemaps_Provider {
*
* @param int $page_num Page of results.
* @param string $object_subtype Optional. Taxonomy name. Default empty.
* @return array Array of URLs for a sitemap.
* @return array[] Array of URL information for a sitemap.
*/
public function get_url_list( $page_num, $object_subtype = '' ) {
// Restores the more descriptive, specific name for use within this method.
@ -76,9 +76,9 @@ class WP_Sitemaps_Taxonomies extends WP_Sitemaps_Provider {
*
* @since 5.5.0
*
* @param array $url_list The URL list. Default null.
* @param string $taxonomy Taxonomy name.
* @param int $page_num Page of results.
* @param array[]|null $url_list The URL list. Default null.
* @param string $taxonomy Taxonomy name.
* @param int $page_num Page of results.
*/
$url_list = apply_filters(
'wp_sitemaps_taxonomies_pre_url_list',
@ -149,15 +149,15 @@ class WP_Sitemaps_Taxonomies extends WP_Sitemaps_Provider {
$taxonomy = $object_subtype;
/**
* Filters the max number of pages before it is generated.
* Filters the max number of pages for a taxonomy sitemap before it is generated.
*
* Passing a non-null value will short-circuit the generation,
* returning that value instead.
*
* @since 5.5.0
*
* @param int $max_num_pages The maximum number of pages. Default null.
* @param string $taxonomy Taxonomy name.
* @param int|null $max_num_pages The maximum number of pages. Default null.
* @param string $taxonomy Taxonomy name.
*/
$max_num_pages = apply_filters( 'wp_sitemaps_taxonomies_pre_max_num_pages', null, $taxonomy );

View File

@ -34,7 +34,7 @@ class WP_Sitemaps_Users extends WP_Sitemaps_Provider {
* @param string $object_subtype Optional. Not applicable for Users but
* required for compatibility with the parent
* provider class. Default empty.
* @return array Array of URLs for a sitemap.
* @return array[] Array of URL information for a sitemap.
*/
public function get_url_list( $page_num, $object_subtype = '' ) {
/**
@ -45,8 +45,8 @@ class WP_Sitemaps_Users extends WP_Sitemaps_Provider {
*
* @since 5.5.0
*
* @param array $url_list The URL list. Default null.
* @param int $page_num Page of results.
* @param array[]|null $url_list The URL list. Default null.
* @param int $page_num Page of results.
*/
$url_list = apply_filters(
'wp_sitemaps_users_pre_url_list',
@ -99,14 +99,14 @@ class WP_Sitemaps_Users extends WP_Sitemaps_Provider {
*/
public function get_max_num_pages( $object_subtype = '' ) {
/**
* Filters the max number of pages before it is generated.
* Filters the max number of pages for a user sitemap before it is generated.
*
* Passing a non-null value will effectively short-circuit the generation,
* returning that value instead.
*
* @since 5.5.0
*
* @param int $max_num_pages The maximum number of pages. Default null.
* @param int|null $max_num_pages The maximum number of pages. Default null.
*/
$max_num_pages = apply_filters( 'wp_sitemaps_users_pre_max_num_pages', null );

View File

@ -2892,7 +2892,7 @@ function wp_add_object_terms( $object_id, $terms, $taxonomy ) {
*
* @param int $object_id The ID of the object from which the terms will be removed.
* @param string|int|array $terms The slug(s) or ID(s) of the term(s) to remove.
* @param array|string $taxonomy Taxonomy name.
* @param string $taxonomy Taxonomy name.
* @return bool|WP_Error True on success, false or WP_Error on failure.
*/
function wp_remove_object_terms( $object_id, $terms, $taxonomy ) {

View File

@ -27,7 +27,7 @@
*
* @since 4.9.0
*
* @param int $thumbnail_id Attachment ID.
* @param int|false $thumbnail_id Attachment ID, or false if there is none.
*/
$thumbnail_id = apply_filters( 'embed_thumbnail_id', $thumbnail_id );

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-alpha-52203';
$wp_version = '5.9-alpha-52204';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -489,7 +489,7 @@ function wp_unregister_sidebar_widget( $id ) {
*
* @since 3.0.0
*
* @param int $id The widget ID.
* @param int|string $id The widget ID.
*/
do_action( 'wp_unregister_sidebar_widget', $id );