Make WordPress Core

Opened 12 years ago

Closed 12 years ago

#21104 closed defect (bug) (fixed)

Taxonomies on attachments should not generate UI is show_ui is false

Reported by: simonwheatley's profile simonwheatley Owned by: markjaquith's profile markjaquith
Milestone: 3.5 Priority: normal
Severity: normal Version: 3.4
Component: Media Keywords: has-patch commit
Focuses: Cc:

Description

Currently if you register a taxonomy and associate it with attachments, the show_ui argument does not affect whether WordPress generates the UI for the taxonomy in the media item edit form. If show_ui is false, then no UI should be generated anywhere in any admin screen.

$args = array(
	'label'   => 'Test Taxonomy',
	'show_ui' => false,
	);
register_taxonomy( 'test', array( 'attachment' ), $args );

Attachments (1)

21104-sw-1.diff (465 bytes) - added by simonwheatley 12 years ago.
Patch to prevent taxonomy fields showing on media item edit form if show_ui is false

Download all attachments as: .zip

Change History (7)

@simonwheatley
12 years ago

Patch to prevent taxonomy fields showing on media item edit form if show_ui is false

#1 @simonwheatley
12 years ago

Fix seems pretty simple, just check for show_ui in get_attachment_fields_to_edit at the same point as we check for the public argument. See patch above.

#2 @SergeyBiryukov
12 years ago

  • Milestone changed from Awaiting Review to 3.5

#3 @nacin
12 years ago

  • Keywords commit added; dev-feedback removed

Before doing this, I just wanted to confirm that show_ui is true by default for register_taxonomy(). That is the case, so I am good with this.

#4 @husobj
12 years ago

  • Cc ben@… added

#5 @markjaquith
12 years ago

show_ui is null by default, and falls through to the value of public, which is true by default.

#6 @markjaquith
12 years ago

  • Owner set to markjaquith
  • Resolution set to fixed
  • Status changed from new to closed

In [21240]:

Hide UI for Attachment taxonomies if show_ui is false for that taxonomy. props simonwheatley. fixes #21104

Note: See TracTickets for help on using tickets.