#24256 closed enhancement (duplicate)
Custom Post Types are hidden by default in the nav-menu page and there's no clean way to prevent that
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | 3.0 |
Component: | Menus | Keywords: | has-patch |
Focuses: | Cc: |
Description
The function wp_initial_nav_menu_meta_boxes
marks all non-built-in meta-boxes as hidden.
This has some unexpected consequences: register_post_type
has an option show_in_nav_menus
and one would guess that setting this to true
would display a meta-box for this post type on the nav-menu UI, but it doesn't.
The real problem is that there is no clean way to prevent that behavior: the only hook available is hidden_meta_boxes
and using it to un-hide meta-boxes also overrides screen-options actually selected by the user. (default_hidden_meta_boxes
is never executed for nav-menus, because of wp_initial_nav_menu_meta_boxes
).
I'm not sure why wp_initial_nav_menu_meta_boxes
was written in the first place, but it should at least provide a hook to add additional $initial_meta_boxes
.
Attachments (1)
Change History (8)
#2
@
12 years ago
- Keywords has-patch added; needs-patch removed
- Type changed from defect (bug) to enhancement
#3
@
12 years ago
I don't think your patch is the correct approach. If a custom post type or taxonomy specifies show_in_nav_menus
as true then they should show up on the nav menu screen without needing to hook into a filter too.
#5
@
12 years ago
@johnbillion I agree with you but I was guessing wp_initial_nav_menu_meta_boxes
was here for a reason. The alternative is to drop that function and its single function call in nav-menus.php altogether.
Add a 'initial_nav_menu_meta_boxes' filter