WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 16 months ago

Last modified 16 months ago

#24103 closed enhancement (fixed)

the wp_dropdown_cats filter should pass the args as a second parameter

Reported by: olivM Owned by: nacin
Milestone: 3.9 Priority: normal
Severity: normal Version: 3.5
Component: Taxonomy Keywords: has-patch
Focuses: template Cc:

Description

effectively filtering the output of the wp_dropdown_categories function is only possible knowing their args

Index: wp-includes/category-template.php
===================================================================
--- wp-includes/category-template.php	(revision 24000)
+++ wp-includes/category-template.php	(working copy)
@@ -370,7 +370,7 @@
 	if ( ! $r['hide_if_empty'] || ! empty($categories) )
 		$output .= "</select>\n";

-	$output = apply_filters( 'wp_dropdown_cats', $output );
+	$output = apply_filters( 'wp_dropdown_cats', $output, $r );

 	if ( $echo )
 		echo $output;

Attachments (1)

wp_dropdown_categories-patch.txt (477 bytes) - added by olivM 2 years ago.
patch to add a second parameter to the wp_dropdown_cats filter

Download all attachments as: .zip

Change History (5)

@olivM2 years ago

patch to add a second parameter to the wp_dropdown_cats filter

comment:2 @SergeyBiryukov2 years ago

  • Component changed from Administration to Template
  • Version changed from trunk to 3.5

comment:3 @nacin16 months ago

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

In 27065:

Add arguments to the wp_dropdown_cats filter, and docs.

props olivM.
fixes #24103.

comment:4 @nacin16 months ago

  • Component changed from Template to Taxonomy
  • Focuses template added
  • Milestone changed from Awaiting Review to 3.9
Note: See TracTickets for help on using tickets.