Make WordPress Core

Opened 9 years ago

Last modified 5 years ago

#31691 new defect (bug)

Taxonomies registered to Attachments post type don't show in media modal if public = false but show_ui = true.

Reported by: husobj's profile husobj Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.1.1
Component: Administration Keywords:
Focuses: administration Cc:

Description

If you register a taxonomy for the attachment post type with the parameters:

public => false,
show_ui => true

If correctly shows the UI meta box when viewing the old-style edit media page.

However, if doesn't show fields in the edit media modal.

If you set public to true then it does show.

The media modal should check the show_ui value to determine wether taxonomy fields should be shown in the attachment media modal.

Attachments (2)

media.php.patch (533 bytes) - added by husobj 9 years ago.
31691.2.patch (910 bytes) - added by maximinime 8 years ago.
Alternative solution

Download all attachments as: .zip

Change History (4)

@husobj
9 years ago

#1 @husobj
9 years ago

The attached patch shows taxonomy fields in the media modal if show_ui is true and a custom metabox callback is not define (i.e. assumes that if meta_box_cb is defined taxonomy fields should be handled by a custom function, not default UI).

@maximinime
8 years ago

Alternative solution

#2 @maximinime
8 years ago

Is it possibly a case of the wrong logic operator? My reckoning is that the intention was to exclude taxonomies that neither have public nor show_ui. If you can edit or publicly show the post type, you can probably attach media to it.

Note: See TracTickets for help on using tickets.