post_type === $page['post_type']) { if ($pagenow == 'post.php' && $page['type'] == "PostType") { $submenu_file = $page['link']; } if ($pagenow == 'edit-tags.php' && $page['type'] == "Taxonomy") { $submenu_file = $page['link']; } $parent_file = static::$page['file']; } } return $parent_file; } public static function view() { Render::view(static::$viewDir); } /** * Add page based on the object of Taxonomy or PostType * * @param type $title * @param object $type */ public static function addPage($title, $type) { $objType; $postType; $link; $i = count(static::$subpages); static::$subpages[$i]['title'] = $title; if ($type instanceof Taxonomy) { $objType = "Taxonomy"; $postType = $type->getPostType(); $link = "edit-tags.php?taxonomy=" . $type->getSlug() . "&post_type=" . $postType; } elseif ($type instanceof PostType) { $objType = "PostType"; $postType = $type->getSlug(); $link = "edit.php?post_type=" . $postType; } static::$subpages[$i]['type'] = $objType; static::$subpages[$i]['link'] = $link; static::$subpages[$i]['post_type'] = $postType; } }