WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 3 months ago

#27286 reopened enhancement

create menu page for custom post types

Reported by: norcross Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.8
Component: General Keywords: has-patch, dev-feedback, bulk-reopened
Focuses: administration Cc:

Description

Currently, there are dedicated functions for adding new items to a top-level navigation item, such as add_posts_page, add_media_page, add_links_page, and so on. These all act as a wrapper for the add_submenu_page. However, there is no dedicated function for custom post types. I am proposing to add a new function called add_post_type_page that works in the same way. It's basically a copy of add_posts_page with an additional parameter for the registered CPT.

Attachments (1)

27286-plugin.php.diff (1.6 KB) - added by norcross 5 years ago.
plugin.php file with additional function

Download all attachments as: .zip

Change History (8)

@norcross
5 years ago

plugin.php file with additional function

#1 @norcross
5 years ago

  • Keywords has-patch dev-feedback added

#2 follow-up: @nacin
5 years ago

Hmm. Aside from the fact that add_post_type_page() is far, far too ambiguous of a name (not your fault, you're just following existing convention), what's the use case here?

Perhaps something like #17447 would solve your issue?

#3 in reply to: ↑ 2 @norcross
5 years ago

Replying to nacin:

Hmm. Aside from the fact that add_post_type_page() is far, far too ambiguous of a name (not your fault, you're just following existing convention), what's the use case here?

Perhaps something like #17447 would solve your issue?

I agree the name is vague, but wasn't sure about naming outside the convention.

My particular use cases are as follows:

  • settings page for a plugin using CPTs
  • archive page info (page title / description) for CPT (not a taxonomy)
  • a drag and drop sorting page for CPT

these are just examples of things I've done this week for actual client work.

the ticket you referenced wouldn't address this as it isn't modifying an argument to the post type itself, rather, adding a new menu page.

actual hook naming aside, my goal here was standardization, since CPTs are now so widely used.

#4 @SergeyBiryukov
5 years ago

  • Version changed from trunk to 3.8

#5 @celloexpressions
4 years ago

  • Component changed from Menus to General
  • Focuses administration added

*Admin* menu, not Menus

#6 @iseulde
5 months ago

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

This ticket has not seen any activity in over *two* years, so I'm closing it as "wontfix".

The ticket may lack decisiveness, may have become irrelevant, or may not have gathered enough interest.

If you think this ticket does deserve some attention again, feel free to reopen.

For bugs, it would be great if you could provide updated steps to reproduce against the latest version of WordPress (5.0.2 at the time of writing). Remember images or a video can be superior to explain a problem. At the very least, quickly test again to make sure the bug still exists.

If it’s an enhancement or feature, some extra motivation may help.

Thank you for your contributions to WordPress! <3

#7 @JeffPaul
3 months ago

  • Keywords bulk-reopened added
  • Milestone set to Awaiting Review
  • Resolution wontfix deleted
  • Status changed from closed to reopened

A decision was made to reopen tickets that were closed in the bulk edit that this ticket was affected by. This ticket is being placed back into the Awaiting Review milestone so it can be individually evaluated and verified to determine if it is still relevant/valid or reproducible.

Note: See TracTickets for help on using tickets.