Support » Plugin: Category Order and Taxonomy Terms Order » Filter Hook for Ignoring Taxonomies

  • Hello,

    Is there a filter hook to tell this plugin to ignore specific taxonomies? I don’t need to add a “Taxonomy Order” subpage for all my taxonomies, just certain ones.

Viewing 1 replies (of 1 total)
  • An alternative to a filter hook ( which really would be nice ) is to remove the submenu pages after the fact. For example:

    /**
     * Remove submenu pages from post types that
     * do not need taoxnonmy ordering
     * 
     * @return void
     */
    function prefix_tto_remove_subpages() {
    	
    	$unorderable_types = array( 'attachment', 'post', 'fl-builder-template' );
    	
    	foreach( $unorderable_types as $post_type ) {
    		
    		if( 'post' === $post_type ) {
    			remove_submenu_page( 'edit.php', "to-interface-{$post_type}" );
    		} else if( 'attachment' === $post_type ) {
    			remove_submenu_page( 'upload.php', "to-interface-{$post_type}" );
    		} else {
    			remove_submenu_page( "edit.php?post_type={$post_type}", "to-interface-{$post_type}" );
    		}
    		
    	}
    	
    }
    add_action( 'admin_menu', 'prefix_tto_remove_subpages', 110 ); // Plugin hook priority at 99
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.