wphooks.info - wp_update_nav_menu

wp_update_nav_menu

(trunk - 5.1-alpha-44286)

The hook occurs in the following 2 files

wp-includes/nav-menu.php:
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
	$menu_id = (int) $update_response['term_id'];

	/**
	 * Fires after a navigation menu has been successfully updated.
	 *
	 * @since 3.0.0
	 *
	 * @param int   $menu_id   ID of the updated menu.
	 * @param array $menu_data An array of menu data.
	 */
	do_action( 'wp_update_nav_menu', $menu_id, $menu_data );
	return $menu_id;
}

/**
 * Save the properties of a menu item or create a new one.
 *
 * The menu-item-title, menu-item-description, and menu-item-attr-title are expected
 * to be pre-slashed since they are passed directly into `wp_insert_post()`.
 *
wp-admin/includes/nav-menu.php:
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
			unset( $nav_menu_option['auto_add'][ $key ] );
		}
	}
	// Remove nonexistent/deleted menus
	$nav_menu_option['auto_add'] = array_intersect( $nav_menu_option['auto_add'], wp_get_nav_menus( array( 'fields' => 'ids' ) ) );
	update_option( 'nav_menu_options', $nav_menu_option );

	wp_defer_term_counting( false );

	/** This action is documented in wp-includes/nav-menu.php */
	do_action( 'wp_update_nav_menu', $nav_menu_selected_id );

	$messages[] = '<div id="message" class="updated notice is-dismissible"><p>' .
		/* translators: %s: nav menu title */
		sprintf(
			__( '%s has been updated.' ),
			'<strong>' . $nav_menu_selected_title . '</strong>'
		) . '</p></div>';

	unset( $menu_items, $unsorted_menu_items );