WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#19795 closed defect (bug) (fixed)

Documentation or code bug in register_taxonomy_for_object_type function (wp-includes/taxonomy.php)

Reported by: transom Owned by: ryan
Milestone: 3.4 Priority: normal
Severity: normal Version: 3.3.1
Component: Taxonomy Keywords:
Focuses: Cc:

Description

The documentation indicates that the post_type can be an array or a string.

However, the code passes the post_type to get_post_type_object without change and that function expects a string (ouch)

So the choices are: change the documentation or loop over an array.

If we loop, what does returning the bool true/false mean? We added all the post_types or just some of the post_types

Happy to provide a diff with feedback on direction

Attachments (1)

register_tax_for_object_type_doc.diff (523 bytes) - added by transom 9 years ago.
docblock patch for register_taxonomy_for_object_type

Download all attachments as: .zip

Change History (5)

#1 @SergeyBiryukov
9 years ago

  • Milestone changed from Awaiting Review to 3.4

Looking at the function, seems that the documentation should just be corrected.

#2 @nacin
9 years ago

Agreed.

@transom
9 years ago

docblock patch for register_taxonomy_for_object_type

#4 @ryan
9 years ago

  • Owner set to ryan
  • Resolution set to fixed
  • Status changed from new to closed

In [19730]:

Update register_taxonomy_for_object_type() phpdoc to reflect that the post_type must be a string only, no arrays allowed. Props transom. fixes #19795

Note: See TracTickets for help on using tickets.