Make WordPress Core

Opened 15 years ago

Closed 13 years ago

#13414 closed enhancement (duplicate)

Custom Taxonomies are not shown for media in the admin menu

Reported by: thee17's profile thee17 Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Media Keywords: needs-patch
Focuses: Cc:

Description

I've been working with adding this code to line 100 of menu.php:

	$i = 25;
	foreach ( $wp_taxonomies as $tax ) {
		if ( ! $tax->show_ui || ! in_array('attachment:image', (array) $tax->object_type, true) )
			continue;

		$submenu['upload.php'][$i++] = array( esc_attr( $tax->labels->name ), $tax->cap->manage_terms, 'edit-tags.php?taxonomy=' . $tax->name );
	}
	unset($tax);

but I cannot figure out yet how to at this point make it work for any attachment:.

Then it probably would be helpful to do the same for pages and new custom post types.

Change History (8)

#1 @thee17
15 years ago

  • Component changed from General to Administration

#2 @olethomas
15 years ago

  • Milestone changed from Unassigned to 3.0

#3 @dd32
15 years ago

  • Milestone changed from 3.0 to Future Release
  • Summary changed from Custom Taxonomies only appear in menu is attached to 'post' to Custom Taxonomies are not shown for media in the admin menu
  • Type changed from defect (bug) to enhancement

Since this code is not in core (yet), i'm changing the title and moving to future. Posts/Pages/Custom post types support taxonomies.

With the provided code, this works:

	register_taxonomy('foobar', array('post', 'attachment:image'), array('label' => 'FooBars', 'show_ui' => true) );

#4 @thee17
15 years ago

  • Keywords needs-patch added

#5 @dd32
14 years ago

So, Seems I've had this on my test install for the last 13 months, There's a bug in this, as expained here: #17973

#6 @thee17
14 years ago

  • Component changed from Administration to Media

I have just succumed to using the following:

add_submenu_page('upload.php', __('People'), __('People'), 'manage_options', 'edit-tags.php?taxonomy=people');

At this point it is just a would be nice. The issue in #17973 is not a problem with this method.

#7 @dd32
14 years ago

The issue in #17973 is not a problem with this method.

Well actually, It is. The menu doesnt recieve the correct highlighting.

See http://wordpress.org/support/topic/adding-a-media-submenu-issuess?replies=6 for a method to give it the correct menu highlighting.

#8 @nacin
13 years ago

  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Can be a duplicate of #21391.

Note: See TracTickets for help on using tickets.