Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#38007 closed defect (bug) (fixed)

Improvements needed to docblock for register_taxonomy()

Reported by: bobbingwide's profile bobbingwide Owned by: boonebgorges's profile boonebgorges
Milestone: 4.7 Priority: normal
Severity: normal Version: 3.0
Component: Taxonomy Keywords:
Focuses: Cc:

Description

I first noticed a spelling mistake.

taxonmies should be taxonomies.

Then I found a few more things to comment on...

In the sentence

The function will accept an array (third optional parameter), along with strings for the taxonomy name and another string for the object type.

This suggests that there could be multiple strings for the taxonomy name.
Perhaps it's wise to remove 'and another string'.

Or delete the whole sentence.

Other questions

  • Is it a taxonomy name, taxonomy key or slug?
  • Is it object type or types?
  • Can you really pass "label"?

See $argslabel? = $argslabels?->name;

Change History (3)

#1 in reply to: ↑ description @bobbingwide
8 years ago

Replying to bobbingwide:

$args['label'] = $args['labels']->name;

#2 @boonebgorges
8 years ago

  • Milestone changed from Awaiting Review to 4.7
  • Version changed from trunk to 3.0

Thanks for the spelling catch.

The entire "A simple function..." paragraph looks superfluous to me. It probably dates from before we had @param docs. Let's cut it.

Can you really pass "label"?

Hm. It appears that you cannot. The ability to pass 'label' was removed when the 'labels' array was introduced in [14614]. In [14619], the documentation was updated to say that 'label' could be passed again - a sort of revert - but the actual functionality was not restored. This part of the documentation has managed to survive a number of reworkings of the docblock.

#3 @boonebgorges
8 years ago

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

In 38737:

Docs: Improvements to register_taxonomy() docblock.

  • Fix spelling and whitespace.
  • Remove $label argument documentation. This argument hasn't worked since [14614], despite the documentation added in [14619].

Props bobbingwide.
Fixes #38007.

Note: See TracTickets for help on using tickets.