Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#52348 closed defect (bug) (fixed)

Docs: inconsistency in `wp_tag_cloud` DocBlock concerning `$number` default value

Reported by: audrasjb's profile audrasjb Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.7 Priority: normal
Severity: normal Version: 5.1
Component: Taxonomy Keywords: has-patch
Focuses: docs Cc:

Description

In wp_tag_cloud(), we have the following documentation:

 *     @type int    $number    The number of tags to display. Accepts any positive integer
 *                             or zero to return all. Default 0 (all tags).

But here are the default values for $args:

	$defaults = array(
		'smallest'   => 8,
		'largest'    => 22,
		'unit'       => 'pt',
		'number'     => 45,
		'format'     => 'flat',
		'separator'  => "\n",
		'orderby'    => 'name',
		'order'      => 'ASC',
		'exclude'    => '',
		'include'    => '',
		'link'       => 'view',
		'taxonomy'   => 'post_tag',
		'post_type'  => '',
		'echo'       => true,
		'show_count' => 0,
	);

We should update the DocBlock accordingly to the real default value.

Attachments (1)

52348.diff (862 bytes) - added by audrasjb 3 years ago.

Download all attachments as: .zip

Change History (7)

#1 @audrasjb
3 years ago

  • Component changed from General to Taxonomy

@audrasjb
3 years ago

#2 @audrasjb
3 years ago

  • Keywords has-patch added; needs-patch removed

#3 @SergeyBiryukov
3 years ago

  • Version set to 5.1

Thanks for the patch! Introduced in [42658] / #42019.

#5 @SergeyBiryukov
3 years ago

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

In 50009:

Docs: Correct default value for the number argument of wp_tag_cloud().

Follow-up to [42658].

Props audrasjb, pawki07.
Fixes #52348.

Note: See TracTickets for help on using tickets.