Make WordPress Core

#58348 closed defect (bug) (invalid)

API Doc: replace wrong string[] type with correct one - array

Reported by: platonkristinin's profile platonkristinin Owned by:
Milestone: Priority: normal
Severity: normal Version: 6.3
Component: General Keywords: has-patch
Focuses: docs Cc:


Wordpress API docs have a lot of places where string[] type is present. PHP doesn't support such data type. This lead into confusions and errors. The "string[]" data type should replaced with "array" data type.


wp_check_filetype( string $filename, string[] $mimes = null ): array


wp_check_filetype( string $filename, array $mimes = null ): array

Attachments (1)

58348.patch (1.1 KB) - added by pkbhatt 13 months ago.
Patch for the ticket 58348

Download all attachments as: .zip

Change History (5)

#1 @platonkristinin
13 months ago

If array argument can be null then function signature should look following:

wp_check_filetype( string $filename, array|null $mimes = null ): array

13 months ago

Patch for the ticket 58348

#2 @pkbhatt
13 months ago

  • Keywords has-patch added

Thanks for the ticket . I have applied patch as per your suggestion .

#3 @pkbhatt
13 months ago

  • Focuses docs added

#4 @johnbillion
13 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

Thanks for the ticket. This is phpDoc array type notation, see the "Arrays" section on for all the details.

Note: See TracTickets for help on using tickets.