wp_nav_menu_taxonomy_meta_boxes()WP 3.0.0

Creates meta boxes for any taxonomy menu item.

Hooks from the function

Return

null. Nothing (null).

Usage

wp_nav_menu_taxonomy_meta_boxes();

Examples

0

#1 Used in the WP core

See the file /wp-admin/nav-menus.php for an example of how to use it.

Changelog

Since 3.0.0 Introduced.

wp_nav_menu_taxonomy_meta_boxes() code WP 6.6

function wp_nav_menu_taxonomy_meta_boxes() {
	$taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'object' );

	if ( ! $taxonomies ) {
		return;
	}

	foreach ( $taxonomies as $tax ) {
		/** This filter is documented in wp-admin/includes/nav-menu.php */
		$tax = apply_filters( 'nav_menu_meta_box_object', $tax );

		if ( $tax ) {
			$id = $tax->name;
			add_meta_box(
				"add-{$id}",
				$tax->labels->name,
				'wp_nav_menu_item_taxonomy_meta_box',
				'nav-menus',
				'side',
				'default',
				$tax
			);
		}
	}
}