Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#34862 closed defect (bug) (fixed)

Document wp_delete_term() $args as a hash notation

Reported by: swissspidy Owned by: slushman
Milestone: 4.5 Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: good-first-bug has-patch commit
Focuses: docs Cc:


As per the @todo comment in wp_delete_term(), the $args parameter should be documented using hash notation.

Currently the param is only somewhat documented in the function description. Without looking at the code closely you have no idea what it is for. The hash notation would make it a lot more readable.

I guess the docblock deservers some overall improvements anyway.

See the PHP documentation standards for more details.

Attachments (2)

#34862-document-wp-delete-term.diff (869 bytes) - added by slushman 6 years ago.
Changed PHPDoc for $args to use hash notation.
34862.diff (1.9 KB) - added by swissspidy 6 years ago.

Download all attachments as: .zip

Change History (6)

6 years ago

Changed PHPDoc for $args to use hash notation.

#1 @slushman
6 years ago

  • Keywords has-patch added; needs-patch removed

6 years ago

#2 @swissspidy
6 years ago

  • Milestone changed from Awaiting Review to 4.5
  • Owner set to slushman
  • Status changed from new to assigned

34862.diff is a small update to the provided patch, moving the description from the DocBlock to the $args description. Also removing the @todo and improving the docs for @return.

#3 @DrewAPicture
6 years ago

  • Keywords commit added

34862.diff looks great. The only thing missing a description of the default for the optional parameter. You can add it to the end of the description:

*    Optional. Array of arguments to override the default term ID. Default empty array.

#4 @DrewAPicture
6 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

In 35889:

Docs: Document the optional $args parameter in wp_delete_term() in the hash notation style.

Props slushman, swissspidy.
Fixes #34862.

Note: See TracTickets for help on using tickets.