WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 8 months ago

Last modified 8 months ago

#16437 closed enhancement (duplicate)

wp_category_checklist should have name parameter

Reported by: takien Owned by:
Milestone: Priority: normal
Severity: minor Version: 3.0.4
Component: General Keywords: close
Focuses: Cc:

Description

I found wp_category_checklist is useful for creating my plugin/theme settings options. Unfortunately, it's currently don't have name parameter, the name is statically defined as post_category in the Walker_Category_Checklist default walker.


wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true )


where it should be something like

wp_category_checklist( $post_id = 0, $descendants_and_self = 0, $selected_cats = false, $popular_cats = false, $walker = null, $checked_ontop = true, $name='post_category' )

So we don't need to create a new walker just to change the name.
Thank you.

Change History (6)

comment:1 sillybean3 years ago

  • Cc steph@… added
  • Keywords changed from wp_category_checklist, category, walker to wp_category_checklist category, walker

comment:2 SergeyBiryukov3 years ago

  • Keywords needs-patch added; wp_category_checklist category walker removed

comment:3 scribu2 years ago

  • Keywords close added; needs-patch removed
  • Severity changed from normal to minor
  • Type changed from feature request to enhancement

wp_category_checklist() should be deprecated. It's just a wrapper for wp_terms_checklist() at this point.

Instead, we should add the parameter directly to wp_terms_checklist() and make it a template tag: #19556

comment:4 sillybean8 months ago

Adding the name parameter would be a quick fix, but if there's agreement about moving to wp_terms_checklist(), I'll work on it.

comment:5 wonderboymusic8 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Duplicate of #19556.

The changes will happen here, which has $args as an array

comment:6 technosailor8 months ago

Yeah, taxonomy specific functions should only be wrappers around appropriate term API methods. +1 To Scribu's take. Go for it, sillybean

Note: See TracTickets for help on using tickets.