Skip to content

Admin menu location support for Taxonomy

Compare
Choose a tag to compare
@lipemat lipemat released this 12 Apr 19:18
· 1120 commits to master since this release

Using the already available "show_in_menu" Taxonomy class property, now supports specifying an admin menu location. This will add the taxonomy menu under the desired parent menu as well as highlight the correct menus when viewing or editing terms.

To simply add the taxonomy under the Tools menu:

use Lipe\Lib\Taxonomy\Taxonomy;
$tax = new Taxonomy( 'example' );  
$tax->show_in_menu = 'tools.php';

To specify which order it should show up in desired menu may be achieved by passing an array:

use Lipe\Lib\Taxonomy\Taxonomy;
$tax = new Taxonomy( 'example' );  
$tax->show_in_menu = [ 'tools.php' => 6 ];