private function printMenuTree() {
		/*
		* The elements in the array are :
		*   0: Menu item name
		*   1: Minimum level or capability required.
		*   2: The URL of the item's file
		*   3: Class
		*   4: ID
		*   5: Icon for top level menu
		*/
		global $menu, $submenu;
		if ( ! is_iterable( $menu ) ) {
			return;
		}

		echo '<ul class="ul-disc">';
		foreach ( $menu as $arr1 ) {
			if ( empty( $arr1[0] ) ) {
				continue;
			}
			$menu_hook = get_plugin_page_hook( $arr1[2], null );
			if ( $menu_hook ) {
				$href = 'admin.php?page=' . $arr1[2];
			} else {
				$href = $arr1[2];
			}
			echo "<li><a href='{$href}'>{$arr1[0]}</a>";
			foreach ( $submenu as $k => $arr2 ) {
				if ( $k === $arr1[2] ) {
					echo '<ul class="ul-disc">';
					foreach ( $arr2 as $arr3 ) {
						$menu_hook = get_plugin_page_hook( $arr3[2], $k );
						if ( $menu_hook ) {
							if ( str_ends_with( $k, '.php' ) ) {
								$href = "{$k}?page={$arr3[2]}";
							} else {
								$href = "admin.php?page={$arr3[2]}";
							}
						} else {
							$href = $arr3[2];
						}
						echo "<li><a href='{$href}'>{$arr3[0]}</a>";
					}
					echo '</ul>';
					continue;
				}
			}
		}
		echo '</ul>';
	}
private function printMenuTree() {
		/*
		* The elements in the array are :
		*   0: Menu item name
		*   1: Minimum level or capability required.
		*   2: The URL of the item's file
		*   3: Class
		*   4: ID
		*   5: Icon for top level menu
		*/
		global $menu, $submenu;
		if ( ! is_iterable( $menu ) ) {
			return;
		}

		echo '<ul class="ul-disc">';
		foreach ( $menu as $arr1 ) {
			if ( empty( $arr1[0] ) ) {
				continue;
			}
			$menu_hook = get_plugin_page_hook( $arr1[2], null );
			if ( $menu_hook ) {
				$href = 'admin.php?page=' . $arr1[2];
			} else {
				$href = $arr1[2];
			}
			echo "<li><a href='{$href}'>{$arr1[0]}</a>";
			foreach ( $submenu as $k => $arr2 ) {
				if ( $k === $arr1[2] ) {
					echo '<ul class="ul-disc">';
					foreach ( $arr2 as $arr3 ) {
						$menu_hook = get_plugin_page_hook( $arr3[2], $k );
						if ( $menu_hook ) {
							if ( str_ends_with( $k, '.php' ) ) {
								$href = "{$k}?page={$arr3[2]}";
							} else {
								$href = "admin.php?page={$arr3[2]}";
							}
						} else {
							$href = $arr3[2];
						}
						echo "<li><a href='{$href}'>{$arr3[0]}</a>";
					}
					echo '</ul>';
					continue;
				}
			}
		}
		echo '</ul>';
	}
private function printMenuTree ( ) { /*
		* The elements in the array are :
		*   0: Menu item name
		*   1: Minimum level or capability required.
		*   2: The URL of the item's file
		*   3: Class
		*   4: ID
		*   5: Icon for top level menu
		*/ global $ menu , $ submenu ; if ( ! is_iterable ( $ menu ) ) { return ; } echo '<ul class="ul-disc">' ; foreach ( $ menu as $ arr1 ) { if ( empty ( $ arr1 [ 0 ] ) ) { continue ; } $ menu_hook = get_plugin_page_hook ( $ arr1 [ 2 ] , null ) ; if ( $ menu_hook ) { $ href = 'admin.php?page=' . $ arr1 [ 2 ] ; } else { $ href = $ arr1 [ 2 ] ; } echo "<li><a href='{$href}'>{$arr1[0]}</a>" ; foreach ( $ submenu as $ k => $ arr2 ) { if ( $ k === $ arr1 [ 2 ] ) { echo '<ul class="ul-disc">' ; foreach ( $ arr2 as $ arr3 ) { $ menu_hook = get_plugin_page_hook ( $ arr3 [ 2 ] , $ k ) ; if ( $ menu_hook ) { if ( str_ends_with ( $ k , '.php' ) ) { $ href = "{$k}?page={$arr3[2]}" ; } else { $ href = "admin.php?page={$arr3[2]}" ; } } else { $ href = $ arr3 [ 2 ] ; } echo "<li><a href='{$href}'>{$arr3[0]}</a>" ; } echo '</ul>' ; continue ; } } } echo '</ul>' ; }
Print Menu & Submenu Tree
Print Menu & Submenu Tree