[wp-trac] [WordPress Trac] #55646: Docblock improvements for 6.1

WordPress Trac noreply at wordpress.org
Tue Jun 21 11:13:37 UTC 2022


#55646: Docblock improvements for 6.1
----------------------------+---------------------
 Reporter:  costdev         |       Owner:  (none)
     Type:  task (blessed)  |      Status:  new
 Priority:  normal          |   Milestone:  6.1
Component:  General         |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:  docs
----------------------------+---------------------

Comment (by SergeyBiryukov):

 In [changeset:"53546" 53546]:
 {{{
 #!CommitTicketReference repository="" revision="53546"
 Docs: Correct the return type for `wp_save_image_file()`.

 Since WordPress 3.5, `wp_save_image_file()` uses `WP_Image_Editor` classes
 under the hood to save the images.

 While the `save()` method in those instances returns `array|WP_Error` and
 is documented as such, the return type of the `wp_save_image_file()`
 function was still left as `bool`.

 A better solution would be to adjust the function to return the documented
 boolean type. However, doing that after 20+ major WP releases would be a
 backward compatibility break, so the documentation is now updated instead.

 Includes:
 * Documenting the returned array using hash notation.
 * Adding a `@since` note for the `$image` parameter expecting a
 `WP_Image_Editor` instance.
 * Adding a `@since` note for the `$filesize` value being included in the
 returned array.

 Follow-up to [22094], [22619], [52837].

 Props jrf, SergeyBiryukov.
 See #55646.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55646#comment:24>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list