• Resolved Ben Huson

    (@husobj)


    This plugin does;t currently support taxonomies registered to the attachment post type – no “Taxonomy Order” menu item is added under “Media” in the admin.

    To fix this:

    1. In taxonomy-terms-order.php plugin file, where the submenu pages are created, adjust to add support for attachment post type:

    if ($post_type == 'post')
    	add_submenu_page('edit.php', __('Taxonomy Order', 'tto'), __('Taxonomy Order', 'tto'), 'level_'.$options['level'], 'to-interface-'.$post_type, 'TOPluginInterface' );
    elseif ($post_type == 'attachment')
    	add_submenu_page('upload.php', __('Taxonomy Order', 'tto'), __('Taxonomy Order', 'tto'), 'level_'.$options['level'], 'to-interface-'.$post_type, 'TOPluginInterface' );
    else
    	add_submenu_page('edit.php?post_type='.$post_type, __('Taxonomy Order', 'tto'), __('Taxonomy Order', 'tto'), 'level_'.$options['level'], 'to-interface-'.$post_type, 'TOPluginInterface' );

    2. In include/interface.php plugin file, where the post type is set based upon getting the URL parameter, also check if it the media page:

    $post_type = isset($_GET['post_type']) ? $_GET['post_type'] : 'post';
    if ( 'to-interface-attachment' == $_GET['page'] ) {
    	$post_type = 'attachment';
    }

    Hope that is useful – would be great if it could be patched in the plugin.

    ??

    https://www.ads-software.com/plugins/taxonomy-terms-order/

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Adding support for attachment taxonomies – patch’ is closed to new replies.