public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/admin/functions.php
/**
 * Safe method to find a subitem on the menu and remove it.
 *
 * @since 1.0.0
 *
 * @param string $submenuName The name of the submenu to search.
 * @param stirng $menuItemID The id of the menu item to be removed.
 */
Safe method to find a subitem on the menu and remove it.

@param string $submenuName The name of the submenu to search.
@param stirng $menuItemID The id of the menu item to be removed.
Safe method to find a subitem on the menu and remove it . @param string $submenuName The name of the submenu to search . @param stirng $menuItemID The id of the menu item to be removed .
function WPCW_menu_removeSubmenuItem( $submenuName, $menuItemID ) {
	global $submenu;
	if ( ! isset( $submenu[ $submenuName ] ) ) {
		return false;
	}
	foreach ( $submenu[ $submenuName ] as $index => $details ) {
		if ( $details[2] == $menuItemID ) {
			unset( $submenu[ $submenuName ][ $index ] );
			return;
		}
	}
}
function WPCW_menu_removeSubmenuItem ( $ submenuName , $ menuItemID ) { global $ submenu ; if ( ! isset ( $ submenu [ $ submenuName ] ) ) { return false ; } foreach ( $ submenu [ $ submenuName ] as $ index => $ details ) { if ( $ details [ 2 ] == $ menuItemID ) { unset ( $ submenu [ $ submenuName ] [ $ index ] ) ; return ; } } }
Safe method to find a subitem on the menu and remove it.
Safe method to find a subitem on the menu and remove it .
// Not found // Search each item of the submenu // Found a matching subitem title // No need to continue searching