Support » Plugins » Adding edit-tags.php?taxonomy to a subpage

  • Resolved David Sword


    I’ve reworked my media library to run on categories. so I have a taxonmony media_category for Media items. I used the edit/manage taxonomy page that wordpress’s Posts & Links use, & just changed the taxonomy query in the url, so my add_submenu_page('upload.php'....) function argument looks like:


    it does work, but when on the edit tax page, the “Active” window in the admin navigation, is highlighting Posts instead of Media … as if it has no idea that the URL belongs to “MEDIA”.. see screen cap: (green highlights that we’re on the highlighted subpage, and the proper content is showing. red highlighing that for some reason, when in the sub-menu “Media Categories”, the “Posts” top level page is highlighted and expanded instead of the “Media” top level page)

    I’ve been stuck on this for 4 hours.. any info would be greatly greatly appreciated..

Viewing 1 replies (of 1 total)
  • Solved. After another wasted day of trouble shooting. Looks like the issue was my PARENT file wasn’t defined, and reverted to default “edit.php” which opened “Posts”

    The solution is to use the “parent_file” filter. in my functions.php:

    if (isset($_GET['taxonomy']) && $_GET['taxonomy'] == 'media_category') {
    	add_filter('parent_file', 'change_parent_to',999);
    function change_parent_to() { return 'my_parent_page' }
Viewing 1 replies (of 1 total)
  • The topic ‘Adding edit-tags.php?taxonomy to a subpage’ is closed to new replies.