WordPress.org

Make WordPress Core

Opened 8 years ago

Last modified 3 years ago

#19556 new enhancement

Make wp_term_checklist() available as a template tag

Reported by: scribu Owned by:
Milestone: Future Release Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch needs-refresh
Focuses: template Cc:

Description

Currently, wp_term_checklist() is defined in wp-admin/includes/template.php, which means it's not available as a template tag for themes.

Note that wp_dropdown_categories() is defined in wp-includes/category-template.php. We should move wp_term_checklist() there too.

Attachments (2)

19556.diff (14.3 KB) - added by sillybean 7 years ago.
Make wp_term_checklist() available as a template tag, add support for 'name' argument
19556.2.diff (22.4 KB) - added by swissspidy 4 years ago.

Download all attachments as: .zip

Change History (13)

#1 @scribu
8 years ago

  • Walker_Category_Checklist also needs to be moved.
  • The current_user_can() check should be extracted out of there.

Not sure what to do with the 'popular_cats' arg.

#2 @scribu
8 years ago

Related: #16437

#3 @wonderboymusic
7 years ago

#16437 was marked as a duplicate.

#4 @sillybean
7 years ago

  • Cc steph@… added

@sillybean
7 years ago

Make wp_term_checklist() available as a template tag, add support for 'name' argument

#5 @sillybean
7 years ago

This patch:

  • moves wp_category_checklist(), wp_terms_checklist(), and Walker_Category_Checklist from wp-admin/includes/template.php to wp-includes/category-template.php
  • adds support for the 'name' argument to wp_terms_checklist() and Walker_Category_Checklist (for #16437)
  • removes the capability check / 'disabled' attribute

I'd appreciate a sanity check on that last point. I couldn't think of any scenarios where the checklist was displayed but disabled, and scribu was right about needing to remove that in order to make the function available as a template tag.

#6 @sillybean
7 years ago

  • Keywords has-patch needs-testing added

#7 @nacin
6 years ago

  • Component changed from Template to Taxonomy
  • Focuses template added

#8 @chriscct7
5 years ago

  • Keywords needs-unit-tests needs-refresh added

@swissspidy
4 years ago

#9 @swissspidy
4 years ago

  • Keywords needs-testing needs-unit-tests needs-refresh removed
  • Milestone changed from Awaiting Review to Future Release

19556.2.diff is an updated patch that applies cleanly against trunk. It does the following:

  • Moves wp_category_checklist() and wp_terms_checklist() from wp-admin/includes/template.php to wp-includes/category-template.php
  • Doesn't move wp_popular_terms_checklist()
  • Moves wp-admin/includes/class-walker-category-checklist.php to wp-includes/class-walker-category-checklist.php
  • Adds support for the $name argument to wp_terms_checklist() / Walker_Category_Checklist (see #16437)

Note: If this gets committed, svn cp would need to be used to move the walker class file.

#10 @swissspidy
4 years ago

  • Keywords needs-refresh good-first-bug added

#11 @DrewAPicture
3 years ago

  • Keywords good-first-bug removed
Note: See TracTickets for help on using tickets.