Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#48681 closed enhancement (fixed)

WP_Taxonomy labels wrong initial type and documentation

Reported by: alpipego Owned by: SergeyBiryukov
Priority: normal Milestone: 5.4
Component: Taxonomy Version: 5.4
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

The initial value of WP_Taxonomy::$labels is an empty array but gets converted to a stdClass object. The docblock comment also states array even though the return correctly says object.

The patch updates the inline documentation and the initial type of $labels.

Attachments (1)

wp_taxonomy-labels.diff (857 bytes ) - added by alpipego 7 years ago.

Download all attachments as: .zip

Change History (4)

#1 @SergeyBiryukov
7 years ago

  • Keywords has-patch added
  • Milestone Awaiting Review5.4
  • Owner set to SergeyBiryukov
  • Status newreviewing

#2 @SergeyBiryukov
7 years ago

  • Resolutionfixed
  • Status reviewingclosed

In 46743:

Taxonomy: Correct the initial value for WP_Taxonomy::$labels to match get_taxonomy_labels() return type.

Improve documentation for consistency with WP_Post_Type::$labels.

Props alpipego.
Fixes #48681.

#3 @SergeyBiryukov
7 years ago

For reference, the value is set in ::set_props(), which runs from ::__construct().

Note: See TracTickets for help on using tickets.