Opened 21 months ago

Last modified 21 months ago

#18653 new enhancement

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

Reported by: transom Owned by:
Priority: normal Milestone: Awaiting Review
Component: General Version: 3.3
Severity: normal Keywords: has-patch
Cc: transom@…

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 21 months ago.

Download all attachments as: .zip

Change History (4)

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.

$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.

  • Cc transom@… added
Note: See TracTickets for help on using tickets.