WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 6 months ago

#37654 closed defect (bug) (fixed)

Documentation for widget_tag_cloud_args filter is wrong

Reported by: swissspidy Owned by: DrewAPicture
Milestone: 4.7 Priority: normal
Severity: normal Version: 2.8
Component: Taxonomy Keywords: good-first-bug has-patch
Focuses: docs Cc:

Description

The docs say that it can be used to filter the taxonomy used in the Tag Cloud widget, but it does way more than that. Not only the taxonomy is being passed to the wp_tag_cloud() function, but instead the whole $args array:

<?php
/**
 * Filters the taxonomy used in the Tag Cloud widget.
 *
 * @since 2.8.0
 * @since 3.0.0 Added taxonomy drop-down.
 *
 * @see wp_tag_cloud()
 *
 * @param array $current_taxonomy The taxonomy to use in the tag cloud. Default 'tags'.
 */
$tag_cloud = wp_tag_cloud( apply_filters( 'widget_tag_cloud_args', array(
        'taxonomy' => $current_taxonomy,
        'echo' => false
) ) );

This needs to be reflected in the docs.

Attachments (1)

37654.diff (606 bytes) - added by backermann 8 months ago.

Download all attachments as: .zip

Change History (10)

#1 @DrewAPicture
8 months ago

Second argument added in [34273] for #16125 in 4.4.

#2 @swissspidy
8 months ago

In addition to that, hash notation for the wp_tag_cloud() docblock would be great too.

@backermann
8 months ago

#3 @backermann
8 months ago

  • Keywords has-patch added; needs-patch removed

Fixed documentation in 37654.diff.

#4 @flixos90
8 months ago

  • Milestone changed from Future Release to 4.7

#5 @jorbin
7 months ago

@DrewAPicture @swissspidy Can you review this one please?

#6 @DrewAPicture
7 months ago

  • Owner set to DrewAPicture
  • Status changed from new to reviewing

Sure.

This ticket was mentioned in Slack in #core by jeffpaul. View the logs.


6 months ago

This ticket was mentioned in Slack in #core by stevenkword. View the logs.


6 months ago

#9 @DrewAPicture
6 months ago

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

In 39053:

Docs: Fix an incorrect pseudo-parameter referenced in the hook doc for the widget_tag_cloud_args filter.

Props backermann.
Fixes #37654.

Note: See TracTickets for help on using tickets.