WordPress.org

Make WordPress Core

Opened 6 weeks ago

Closed 6 weeks ago

Last modified 6 weeks ago

#52348 closed defect (bug) (fixed)

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

Reported by: audrasjb Owned by: 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 6 weeks ago.

Download all attachments as: .zip

Change History (7)

#1 @audrasjb
6 weeks ago

  • Component changed from General to Taxonomy

@audrasjb
6 weeks ago

#2 @audrasjb
6 weeks ago

  • Keywords has-patch added; needs-patch removed

#3 @SergeyBiryukov
6 weeks ago

  • Version set to 5.1

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

#5 @SergeyBiryukov
6 weeks 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.