Un motore di ricerca WordPress per sviluppatori e autori di temi



remove_submenu_page ›

Da3.1.0
Deprecaton/a
remove_submenu_page ( $menu_slug, $submenu_slug )
Parametri: (2)
  • (string) $menu_slug The slug for the parent menu.
    Richiesto:
  • (string) $submenu_slug The slug of the submenu.
    Richiesto:
Ritorna:
  • (array|bool) The removed submenu on success, false if not found.
Definito a:
Codex:

Remove an admin submenu.



Sorgenti

function remove_submenu_page( $menu_slug, $submenu_slug ) {
	global $submenu;

	if ( ! isset( $submenu[ $menu_slug ] ) ) {
		return false;
	}

	foreach ( $submenu[ $menu_slug ] as $i => $item ) {
		if ( $submenu_slug == $item[2] ) {
			unset( $submenu[ $menu_slug ][ $i ] );
			return $item;
		}
	}

	return false;
}