Uma área de pesquisa sobre o WordPress para devs e autores do tema



remove_submenu_page ›

Desde3.1.0
Obsoleton/a
remove_submenu_page ( $menu_slug, $submenu_slug )
Parâmetros: (2)
  • (string) $menu_slug The slug for the parent menu.
    Required: Yes
  • (string) $submenu_slug The slug of the submenu.
    Required: Yes
Retorna:
  • (array|bool) The removed submenu on success, false if not found.
Definido em:
Codex:

Remove an admin submenu.



Fonte

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;
}