wordpress/wp-content/themes/basic/themify/megamenu/class-mega-menu.php
/**
 * Save the mega menu option for menu items
 *
 * @since 1.0.0
 */
Save the mega menu option for menu items
@since 1.0.0
Save the mega menu option for menu items @since 1 . 0 . 0
function themify_update_mega_menu_option( $menu_id, $menu_item_db_id, $args ) {
	$meta_keys = array(
		'_themify_mega_menu_item_tax' => 'menu-item-tf-mega_tax',
		'_themify_dropdown_columns'   => 'menu-item-tf-dropdown_columns',
		'_themify_mega_menu_columns_layout'   => 'menu-item-tf-mega-columns-layout',
		'_themify_highlight_link'   => 'menu-item-tf-highlight',
	);
	if( isset( $_POST['menu-item-tf-mega'][$menu_item_db_id] ) ) {
		delete_post_meta( $menu_item_db_id, '_themify_mega_menu_item' );
		delete_post_meta( $menu_item_db_id, '_themify_mega_menu_column' );
		if( $_POST['menu-item-tf-mega'][$menu_item_db_id] != '' ) {
			if( $_POST['menu-item-tf-mega'][$menu_item_db_id] === 'mega' ) {
				update_post_meta( $menu_item_db_id, '_themify_mega_menu_item', 1 );
			} elseif( $_POST['menu-item-tf-mega'][$menu_item_db_id] === 'columns' ) {
				update_post_meta( $menu_item_db_id, '_themify_mega_menu_column', 1 );
			}
		}
	}
	foreach ( $meta_keys as $meta_key => $param_key ) {
		$new_meta_value = isset( $_POST[$param_key] , $_POST[$param_key][$menu_item_db_id] ) ? $_POST[$param_key][$menu_item_db_id] : false;
		if ( $new_meta_value ) {
			update_post_meta( $menu_item_db_id, $meta_key, $new_meta_value );
		} else {
			delete_post_meta( $menu_item_db_id, $meta_key );
		}
	}
}
function themify_update_mega_menu_option ( $ menu_id , $ menu_item_db_id , $ args ) { $ meta_keys = array ( '_themify_mega_menu_item_tax' => 'menu-item-tf-mega_tax' , '_themify_dropdown_columns' => 'menu-item-tf-dropdown_columns' , '_themify_mega_menu_columns_layout' => 'menu-item-tf-mega-columns-layout' , '_themify_highlight_link' => 'menu-item-tf-highlight' , ) ; if ( isset ( $ _POST [ 'menu-item-tf-mega' ] [ $ menu_item_db_id ] ) ) { delete_post_meta ( $ menu_item_db_id , '_themify_mega_menu_item' ) ; delete_post_meta ( $ menu_item_db_id , '_themify_mega_menu_column' ) ; if ( $ _POST [ 'menu-item-tf-mega' ] [ $ menu_item_db_id ] != '' ) { if ( $ _POST [ 'menu-item-tf-mega' ] [ $ menu_item_db_id ] === 'mega' ) { update_post_meta ( $ menu_item_db_id , '_themify_mega_menu_item' , 1 ) ; } elseif ( $ _POST [ 'menu-item-tf-mega' ] [ $ menu_item_db_id ] === 'columns' ) { update_post_meta ( $ menu_item_db_id , '_themify_mega_menu_column' , 1 ) ; } } } foreach ( $ meta_keys as $ meta_key => $ param_key ) { $ new_meta_value = isset ( $ _POST [ $ param_key ] , $ _POST [ $ param_key ] [ $ menu_item_db_id ] ) ? $ _POST [ $ param_key ] [ $ menu_item_db_id ] : false ; if ( $ new_meta_value ) { update_post_meta ( $ menu_item_db_id , $ meta_key , $ new_meta_value ) ; } else { delete_post_meta ( $ menu_item_db_id , $ meta_key ) ; } } }
Save the mega menu option for menu items
 @since 1.0.0
Save the mega menu option for menu items @since 1 . 0 . 0
/**
	 * save Mega Menu <select> option
	 * the Mega Menu option saves as two different custom fields, for backwards compatibility
	 */ /* delete both keys first to ensure they are not both activated on a menu item at the same time */