WordPress.org

Make WordPress Core

Opened 2 years ago

Last modified 3 months ago

#19556 new enhancement

Make wp_term_checklist() available as a template tag

Reported by: scribu Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords: has-patch needs-testing
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 (1)

19556.diff (14.3 KB) - added by sillybean 8 months ago.
Make wp_term_checklist() available as a template tag, add support for 'name' argument

Download all attachments as: .zip

Change History (8)

comment:1 scribu2 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.

comment:2 scribu2 years ago

Related: #16437

comment:3 wonderboymusic8 months ago

#16437 was marked as a duplicate.

comment:4 sillybean8 months ago

  • Cc steph@… added

sillybean8 months ago

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

comment:5 sillybean8 months 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.

comment:6 sillybean8 months ago

  • Keywords has-patch needs-testing added

comment:7 nacin3 months ago

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