WC_Admin_Importers::hide_from_menus()publicWC 1.0

Hide menu items from view so the pages exist, but the menu items do not.

Method of the class: WC_Admin_Importers{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Admin_Importers = new WC_Admin_Importers();
$WC_Admin_Importers->hide_from_menus();

WC_Admin_Importers::hide_from_menus() code WC 8.6.1

public function hide_from_menus() {
	global $submenu;

	foreach ( $this->importers as $id => $importer ) {
		if ( isset( $submenu[ $importer['menu'] ] ) ) {
			foreach ( $submenu[ $importer['menu'] ] as $key => $menu ) {
				if ( $id === $menu[2] ) {
					unset( $submenu[ $importer['menu'] ][ $key ] );
				}
			}
		}
	}
}