• Resolved alexbarber

    (@alexbarber)


    I’m using version 1.4.3 of the plugin, and a custom taxonomy that I’ve defined and used elsewhere in the site does not display when I select a media item to edit.

    Here’s what I’ve used to define that taxonomy:

    $labels = array(
            'name' => _x( 'Destinations', 'destinations' ),
            'singular_name' => _x( 'Destination', 'destinations' ),
            'search_items' => _x( 'Search Destinations', 'destinations' ),
            'popular_items' => _x( 'Popular Destinations', 'destinations' ),
            'all_items' => _x( 'All Destinations', 'destinations' ),
            'parent_item' => _x( 'Parent Destination', 'destinations' ),
            'parent_item_colon' => _x( 'Parent Destination:', 'destinations' ),
            'edit_item' => _x( 'Edit Destination', 'destinations' ),
            'update_item' => _x( 'Update Destination', 'destinations' ),
            'add_new_item' => _x( 'Add New Destination', 'destinations' ),
            'new_item_name' => _x( 'New Destination', 'destinations' ),
            'separate_items_with_commas' => _x( 'Separate destinations with commas', 'destinations' ),
            'add_or_remove_items' => _x( 'Add or remove destinations', 'destinations' ),
            'choose_from_most_used' => _x( 'Choose from the most used destinations', 'destinations' ),
            'menu_name' => _x( 'Destinations', 'destinations' ),
        );
    
        $args = array(
            'labels' => $labels,
            'public' => true,
            'show_in_nav_menus' => true,
            'show_ui' => true,
            'show_tagcloud' => false,
            'show_admin_column' => true,
            'hierarchical' => true,
            'rewrite' => array( 'slug' => 'destinations', 'hierarchical' => true ),
            'query_var' => true
        );
    
        register_taxonomy( 'destinations', array('hotel','restaurant','shop','activity','article','offer','insidertrip'), $args );

    Under the general settings for the plugin, I’ve selected “Support” and “Inline Edit” for “Destinations”. I’ve tried this with “Categories” and “Destinations” checked for “List Filter”

    I read in an earlier thread about a problem with version 1.4 of the plugin not displaying custom taxonomy correctly, so I’m not sure what I’ve missed, unless my taxonomy registration has an error in there.

    https://www.ads-software.com/plugins/media-library-assistant/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author David Lingren

    (@dglingren)

    Thanks for your interest in the plugin, for this question and for taking the time to include the PHP code you’re using to set up the taxonomy.

    I have copied the code from your post into my test system, and everything is working fine for me. The Destinations taxonomy appears in the Media menu as a sub item. The taxonomy appears in the Quick Edit and Bulk Edit areas. The taxonomy appears in the right hand column of the Edit Media screen. If I select the “List Filter” radio button for the taxonomy it shows up on the Media/Assistant screen as the filter criteria.

    In your report you say

    does not display when I select a media item to edit

    Do you mean the Edit Media screen? Does the taxonomy appear in the other places I have listed above?

    If you pull down the Screen Options in the upper-right corner of the Edit Media screen, does Destinations appear in the “Show on screen” list? If so, is the box to the left of Destinations checked?

    It sounds like you have done everything right. Let me know the answers to these additional questions and I’ll do what I can to help.

    Thread Starter alexbarber

    (@alexbarber)

    I completely spaced and forgot to add the ‘attachment’ type to the list of post types registered with my taxonomy. With that in place, everything displays.

    Plugin Author David Lingren

    (@dglingren)

    Well, the MLA plugin is supposed to do that for you, but it’s possible that you are registering the taxonomy after MLA looks for it but before the Settings/Media Library Assistant screen is composed. Can you tell me when your code runs, i.e., in a filter or action or at some other point?

    I’m happy that you’ve found a solution but maybe there’s something I can do to prevent future problems of this sort. Thanks for your help!

    Thread Starter alexbarber

    (@alexbarber)

    I create my custom taxonomies at the top of my theme functions.php file with ‘add_action’ hooks run on ‘init’.

    Plugin Author David Lingren

    (@dglingren)

    I have released version 1.50, which changes the timing of MLA logic to detect and support custom taxonomies. This change should remove the need for you to explicitly register your taxonomies for the ‘attachment’ post type.

    If you have the time and interest in testing this fix I would be interested to hear if it works for you.

    Thanks again for your interest and for working with me on this issue.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom taxonomy does not display’ is closed to new replies.