Make WordPress Core

Opened 3 years ago

Last modified 14 months ago

#20167 new enhancement

Add wp_pages_checklist for creating checklist of pages on site

Reported by: jackreichert Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Posts, Post Types Keywords: has-patch
Focuses: template Cc:


Per conclusion of ticket #20156

"If someone does write a patch that implements wp_posts_checklist() and
uses it in nav-menus.php, please open a new ticket."

The attached patch:

  • extends Walker with Walker_Page_Checklist
  • adds wp_pages_checklist() and wp_pages_checklist() functions

functionality structure was modeled after wp_category_checklist and wp_dropdown_pages to keep with WP standards.

If this patch is accepted my intention is to finish the request and implement it into nav-menus.php.

Attachments (2)

post-template.wp_pages_checklist.diff (2.4 KB) - added by jackreichert 3 years ago.
post-template.wp_pages_checklist-post_types.diff (2.6 KB) - added by jackreichert 3 years ago.

Download all attachments as: .zip

Change History (8)

comment:1 @DrewAPicture3 years ago

  • Cc xoodrew@… added

I'd think since we have the taxonomy-agnostic wp_terms_checklist, we'd do better to introduce a content-agnostic version for hierarchical post types too rather that one specifically for pages. Maybe wp_post_type_checklist or wp_content_checklist or something of that vein.

We're at a time when custom post (content) types are being used all over the place, it feels like it would be a step back not to cover all our bases now and make it future-proof.

#20054 is semi-related.

Version 0, edited 3 years ago by DrewAPicture (next)

comment:2 @scribu3 years ago

What DrewAPicture said.

Also, are you sure there already isn't a checklist walker for this already? Related: [17796]

Last edited 3 years ago by scribu (previous) (diff)

comment:3 @jackreichert3 years ago

Apt insight. I'll work on a post_type version of the patch, shouldn't be difficult to modify.

I looked through the code for a checklist page walker, there is one for categories, but not pages/post_types.

comment:4 @jackreichert3 years ago

I've adapted the patch to work with post_types.

Note: Since get_posts in now used vs. get_pages, the 'child_of' option does not work and was removed.

If this patch is approved I will work to refactor the nav-menus.php to incorporate the new function.

I look forward to your feedback.

Last edited 3 years ago by jackreichert (previous) (diff)

comment:5 @jackreichert3 years ago

  • Cc jack@… added

comment:6 @nacin14 months ago

  • Component changed from Template to Posts, Post Types
  • Focuses template added
Note: See TracTickets for help on using tickets.