WC_Admin_Exporters::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_Exporters{}

No Hooks.

Return

null. Nothing (null).

Usage

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

WC_Admin_Exporters::hide_from_menus() code WC 8.7.0

public function hide_from_menus() {
	global $submenu;

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