WC_Admin_Importers::hide_from_menus()
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() WC Admin Importers::hide from menus code WC 9.7.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 ] ); } } } } }