Docs: Fix some incorrect return tags in docblocks.

See #48303


git-svn-id: https://develop.svn.wordpress.org/trunk@46644 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn 2019-11-03 22:21:20 +00:00
parent 83366144b3
commit 27b67d5624
16 changed files with 41 additions and 33 deletions

View File

@ -348,7 +348,7 @@ class WP_Upgrader {
*
* @param array $nested_files Array of files as returned by WP_Filesystem::dirlist()
* @param string $path Relative path to prepend to child nodes. Optional.
* @return array $files A flattened array of the $nested_files specified.
* @return array A flattened array of the $nested_files specified.
*/
protected function flatten_dirlist( $nested_files, $path = '' ) {
$files = array();

View File

@ -1001,7 +1001,7 @@ function add_contextual_help( $screen, $help ) {
* @deprecated 3.4.0 Use wp_get_themes()
* @see wp_get_themes()
*
* @return array $themes Array of allowed themes.
* @return WP_Theme[] Array of WP_Theme objects keyed by their name.
*/
function get_allowed_themes() {
_deprecated_function( __FUNCTION__, '3.4.0', "wp_get_themes( array( 'allowed' => true ) )" );

View File

@ -244,7 +244,12 @@ function wp_create_image_subsizes( $file, $attachment_id ) {
* @since 5.3.0
*
* @param int $threshold The threshold value in pixels. Default 2560.
* @param array $imagesize Indexed array of the image width and height (in that order).
* @param array $imagesize {
* Indexed array of the image width and height in pixels.
*
* @type int $0 The image width.
* @type int $0 The image height.
* }
* @param string $file Full path to the uploaded image file.
* @param int $attachment_id Attachment post ID.
*/
@ -535,8 +540,8 @@ function wp_generate_attachment_metadata( $attachment_id, $file ) {
*
* @since 4.7.0
*
* @param array $fallback_sizes An array of image size names.
* @param array $metadata Current attachment metadata.
* @param string[] $fallback_sizes An array of image size names.
* @param array $metadata Current attachment metadata.
*/
$fallback_sizes = apply_filters( 'fallback_intermediate_image_sizes', $fallback_sizes, $metadata );

View File

@ -1126,7 +1126,7 @@ function _wp_delete_orphaned_draft_menu_items() {
*
* @param int|string $nav_menu_selected_id (id, slug, or name ) of the currently-selected menu
* @param string $nav_menu_selected_title Title of the currently-selected menu
* @return array $messages The menu updated message
* @return array The menu updated message
*/
function wp_nav_menu_update_menu_items( $nav_menu_selected_id, $nav_menu_selected_title ) {
$unsorted_menu_items = wp_get_nav_menu_items(

View File

@ -1104,7 +1104,7 @@ final class WP_Customize_Widgets {
* @since 4.2.0
*
* @param array $nonces Array of nonces.
* @return array $nonces Array of nonces.
* @return array Array of nonces.
*/
public function refresh_nonces( $nonces ) {
$nonces['update-widget'] = wp_create_nonce( 'update-widget' );

View File

@ -3393,7 +3393,7 @@ function wp_handle_comment_submission( $comment_data ) {
* @since 4.9.6
*
* @param array $exporters An array of personal data exporters.
* @return array $exporters An array of personal data exporters.
* @return array An array of personal data exporters.
*/
function wp_register_comment_personal_data_exporter( $exporters ) {
$exporters['wordpress-comments'] = array(
@ -3411,7 +3411,7 @@ function wp_register_comment_personal_data_exporter( $exporters ) {
*
* @param string $email_address The comment author email address.
* @param int $page Comment page.
* @return array $return An array of personal data.
* @return array An array of personal data.
*/
function wp_comments_personal_data_exporter( $email_address, $page = 1 ) {
// Limit us to 500 comments at a time to avoid timing out.
@ -3503,7 +3503,7 @@ function wp_comments_personal_data_exporter( $email_address, $page = 1 ) {
* @since 4.9.6
*
* @param array $erasers An array of personal data erasers.
* @return array $erasers An array of personal data erasers.
* @return array An array of personal data erasers.
*/
function wp_register_comment_personal_data_eraser( $erasers ) {
$erasers['wordpress-comments'] = array(

View File

@ -76,8 +76,12 @@ function wp_embed_defaults( $url = '' ) {
*
* @since 2.9.0
*
* @param array $size An array of embed width and height values
* in pixels (in that order).
* @param array $size {
* Indexed array of the embed width and height in pixels.
*
* @type int $0 The embed width.
* @type int $0 The embed height.
* }
* @param string $url The URL that should be embedded.
*/
return apply_filters( 'embed_defaults', compact( 'width', 'height' ), $url );

View File

@ -6395,7 +6395,7 @@ function wp_auth_check_html() {
* @global int $login_grace_period
*
* @param array $response The Heartbeat response.
* @return array $response The Heartbeat response with 'wp-auth-check' value set.
* @return array The Heartbeat response with 'wp-auth-check' value set.
*/
function wp_auth_check( $response ) {
$response['wp-auth-check'] = is_user_logged_in() && empty( $GLOBALS['login_grace_period'] );

View File

@ -1107,8 +1107,7 @@ function _wp_get_attachment_relative_path( $file ) {
*
* @param string $size_name Image size. Accepts any valid image size name ('thumbnail', 'medium', etc.).
* @param array $image_meta The image meta data.
* @return array|bool Array of width and height values in pixels (in that order)
* or false if the size doesn't exist.
* @return array|bool The image meta data as returned by `wp_get_attachment_metadata()`.
*/
function _wp_get_image_size_from_meta( $size_name, $image_meta ) {
if ( $size_name === 'full' ) {

View File

@ -2577,7 +2577,7 @@ function wp_is_large_network( $using = 'sites', $network_id = null ) {
*
* @since 4.4.0
*
* @return array $names Array of reserved subdirectory names.
* @return array Array of reserved subdirectory names.
*/
function get_subdirectory_reserved_names() {
$names = array(

View File

@ -1165,7 +1165,7 @@ function rest_is_boolean( $maybe_bool ) {
*
* @param mixed $id_or_email The Gravatar to retrieve a URL for. Accepts a user_id, gravatar md5 hash,
* user email, WP_User object, WP_Post object, or WP_Comment object.
* @return array $urls Gravatar url for each size.
* @return array Gravatar url for each size.
*/
function rest_get_avatar_urls( $id_or_email ) {
$avatar_sizes = rest_get_avatar_sizes();

View File

@ -177,7 +177,7 @@ class Tests_Ajax_PrivacyErasePersonalData extends WP_Ajax_UnitTestCase {
*
* @param array $erasers List of data erasers.
*
* @return array $erasersList of data erasers.
* @return array Array of data erasers.
*/
public function filter_eraser_callback_value( $erasers ) {
$erasers[ self::$eraser_key ]['callback'] = $this->new_callback_value;
@ -204,7 +204,7 @@ class Tests_Ajax_PrivacyErasePersonalData extends WP_Ajax_UnitTestCase {
*
* @param array $erasers Erasers.
*
* @return array $erasers Erasers.
* @return array Erasers.
*/
public function filter_unset_eraser_index( $erasers ) {
if ( false === $this->key_to_unset ) {
@ -236,7 +236,7 @@ class Tests_Ajax_PrivacyErasePersonalData extends WP_Ajax_UnitTestCase {
* @param string $email_address The requester's email address.
* @param int $page Page number.
*
* @return array $return Export data.
* @return array Export data.
*/
public function filter_unset_response_index( $email_address, $page = 1 ) {
$response = $this->callback_personal_data_eraser( $email_address, $page );
@ -649,7 +649,7 @@ class Tests_Ajax_PrivacyErasePersonalData extends WP_Ajax_UnitTestCase {
* @param string $email_address The requester's email address.
* @param int $page Page number.
*
* @return array $return Export data.
* @return array Export data.
*/
public function filter_response_messages_invalid( $email_address, $page = 1 ) {
$response = $this->callback_personal_data_eraser( $email_address, $page );
@ -770,7 +770,7 @@ class Tests_Ajax_PrivacyErasePersonalData extends WP_Ajax_UnitTestCase {
*
* @param array $erasers An array of personal data erasers.
*
* @return array $erasers An array of personal data erasers.
* @return array An array of personal data erasers.
*/
public function register_custom_personal_data_eraser( $erasers ) {
$erasers[ self::$eraser_key ] = array(

View File

@ -188,7 +188,7 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase {
* @since 5.2.0
*
* @param array $exporters List of data exporters.
* @return array $exporters List of data exporters.
* @return array List of data exporters.
*/
public function filter_exporter_callback_value( $exporters ) {
$exporters[ self::$exporter_key ]['callback'] = $this->new_callback_value;
@ -211,7 +211,7 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase {
*
* @param array $exporters List of data exporters.
*
* @return array $exporters List of data exporters.
* @return array List of data exporters.
*/
public function filter_unset_exporter_key( $exporters ) {
if ( false === $this->key_to_unset ) {
@ -589,7 +589,7 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase {
* @param string $email_address The requester's email address.
* @param int $page Page number.
*
* @return array $return Export data.
* @return array Export data.
*/
public function callback_missing_data_response( $email_address, $page = 1 ) {
$response = $this->callback_custom_personal_data_exporter( $email_address, $page );
@ -625,7 +625,7 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase {
* @param string $email_address The requester's email address.
* @param int $page Page number.
*
* @return array $return Export data.
* @return array Export data.
*/
public function callback_missing_data_array_response( $email_address, $page = 1 ) {
$response = $this->callback_custom_personal_data_exporter( $email_address, $page );
@ -660,7 +660,7 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase {
* @param string $email_address The requester's email address.
* @param int $page Page number.
*
* @return array $return Export data.
* @return array Export data.
*/
public function callback_missing_done_response( $email_address, $page = 1 ) {
$response = $this->callback_custom_personal_data_exporter( $email_address, $page );
@ -739,7 +739,7 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase {
* @param bool $send_as_email Whether the final results of the export should be emailed to the user.
* @param string $exporter_key The key (slug) of the exporter that provided this data.
*
* @return array $response The personal data for the given exporter and page.
* @return array The personal data for the given exporter and page.
*/
public function filter_exporter_data_response( $response, $exporter_index, $email_address, $page, $request_id, $send_as_email, $exporter_key ) {
$group_label = sprintf(
@ -767,7 +767,7 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase {
*
* @param array $exporters An array of personal data exporters.
*
* @return array $exporters An array of personal data exporters.
* @return array An array of personal data exporters.
*/
public function filter_register_custom_personal_data_exporter( $exporters ) {
$exporters[ self::$exporter_key ] = array(
@ -785,7 +785,7 @@ class Tests_Ajax_PrivacyExportPersonalData extends WP_Ajax_UnitTestCase {
* @param string $email_address The requester's email address.
* @param int $page Page number.
*
* @return array $response Export data response.
* @return array Export data response.
*/
public function callback_custom_personal_data_exporter( $email_address, $page = 1 ) {
$data_to_export = array();

View File

@ -71,7 +71,7 @@ class Tests_Comment_IsAvatarCommentType extends WP_UnitTestCase {
* @since 5.1.0
*
* @param array $types An array of content types.
* @return array $types An array of content types.
* @return array An array of content types.
*/
public function _filter_avatar_comment_types( $types ) {
$types[] = 'review';

View File

@ -233,7 +233,7 @@ class Tests_Functions_DoEnclose extends WP_UnitTestCase {
*
* @param array $post_links An array of enclosure links.
* @param int $post_id Post ID.
* @return array $post_links An array of enclosure links.
* @return array An array of enclosure links.
*/
public function filter_enclosure_links( $enclosure_links, $post_id ) {
// Replace the link host to contain the post ID, to test both filter input arguments.

View File

@ -210,7 +210,7 @@ class Tests_Privacy_WpPrivacyProcessPersonalDataExportPage extends WP_UnitTestCa
* @since 5.2.0
*
* @param array $exporters An array of personal data exporters.
* @return array $exporters An array of personal data exporters.
* @return array An array of personal data exporters.
*/
public function filter_register_custom_personal_data_exporters( $exporters ) {
// Let's override other unrelated exporters.