Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#58049 closed defect (bug) (fixed)

Add default value to the @param tag for the constructor in /wp-admin/includes/class-custom-image-header.php

Reported by: faisalahammad Owned by: SergeyBiryukov
Priority: normal Milestone: 6.5
Component: General Version: 6.3
Severity: normal Keywords: has-patch changes-requested
Cc: Focuses: coding-standards

Description

WordPress coding standard recommends adding default values to the @param tag for functions that have default values for parameters. In the /wp-admin/includes/class-custom-image-header.php file, the constructor function has a parameter named $admin_image_div_callback, but there is no default value mentioned in the @param tag.

Change History (7)

This ticket was mentioned in PR #4283 on WordPress/wordpress-develop by @faisalahammad.


3 years ago
#1

  • Keywords has-patch added; needs-patch removed

I added "Default false" to the @param tag for the $admin_image_div_callback parameter, so that it is clear to developers that this parameter is optional and its default value is false.

Trac ticket: 58049

#2 @cadic
3 years ago

@faisalahammad I've added a review to the PR, looks like we need to change $admin_image_div_callback parameter, but another parameter was updated in the code.

#3 @cadic
3 years ago

  • Keywords changes-requested added

#4 @faisalahammad
3 years ago

Thank you @cadic
I've made changes and sent another PR.

Could you please check and let me know how that goes?

#5 @SergeyBiryukov
3 years ago

  • Milestone Awaiting Review6.5

#6 @SergeyBiryukov
3 years ago

  • Owner set to SergeyBiryukov
  • Resolutionfixed
  • Status newclosed

In 57169:

Docs: Improve documentation for Custom_Image_Header and Custom_Background constructors.

Follow-up to [4673], [8656], [12890], [13041].

Props faisalahammad, cadic.
Fixes #58049.

@SergeyBiryukov commented on PR #4283:


3 years ago
#7

Thanks for the PR! Merged in r57169.

Note: See TracTickets for help on using tickets.