Make WordPress Core

Opened 12 years ago

Closed 9 years ago

#18653 closed enhancement (worksforme)

Enhancement: Filter Taxonomy Show UI in post editor (edit-form-advanced.php)

Reported by: transom's profile transom Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.3
Component: General Keywords: has-patch
Focuses: Cc:

Description

I am working on a project that maintains a "hidden" taxonomy. I want to expose the taxonomy selectively on various custom post types.

The attached patch filters a taxonomy's show_ui value before deciding to create a meta_box. The filter also passes the taxonomy object as well as the current post type.

Attachments (1)

show_tax_ui_post_editor.diff (526 bytes) - added by transom 12 years ago.

Download all attachments as: .zip

Change History (5)

#1 @nacin
12 years ago

You could simply selectively set show_ui when registering the post type on each pageload. Then you can check the $current_screen object to see what page you're on.

#2 @transom
12 years ago

$current_screen object isn't created until after "admin_init" which is causing all sorts of contortions to setup the cpt, This will be problematic in the future since anyone else approaching the application in the future will expect to see it hooked to init.

#3 @transom
12 years ago

  • Cc transom@… added

#4 @nacin
9 years ago

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

I believe it is now possible to pass a callback to register_taxonomy() specifying the meta box, with the ability to hide it all together. Please reopen if this is insufficient.

Note: See TracTickets for help on using tickets.