diff --git wp-includes/default-filters.php wp-includes/default-filters.php
index de97238..68cfed2 100644
|
|
add_action( 'welcome_panel', 'wp_welcome_panel' |
264 | 264 | |
265 | 265 | // Navigation menu actions |
266 | 266 | add_action( 'delete_post', '_wp_delete_post_menu_item' ); |
267 | | add_action( 'delete_term', '_wp_delete_tax_menu_item' ); |
| 267 | add_action( 'delete_term', '_wp_delete_tax_menu_item', 10, 3 ); |
268 | 268 | add_action( 'transition_post_status', '_wp_auto_add_pages_to_menu', 10, 3 ); |
269 | 269 | |
270 | 270 | // Post Thumbnail CSS class filtering |
diff --git wp-includes/nav-menu.php wp-includes/nav-menu.php
index 794f4b2..eab50c9 100644
|
|
function wp_setup_nav_menu_item( $menu_item ) { |
685 | 685 | * |
686 | 686 | * @param int $object_id The ID of the original object. |
687 | 687 | * @param string $object_type The type of object, such as "taxonomy" or "post_type." |
| 688 | * @param string $taxonomy If $object_type is "taxonomy", $taxonomy is the name of the tax that $object_id belongs to |
688 | 689 | * @return array The array of menu item IDs; empty array if none; |
689 | 690 | */ |
690 | | function wp_get_associated_nav_menu_items( $object_id = 0, $object_type = 'post_type' ) { |
| 691 | function wp_get_associated_nav_menu_items( $object_id = 0, $object_type = 'post_type', $taxonomy = '' ) { |
691 | 692 | $object_id = (int) $object_id; |
692 | 693 | $menu_item_ids = array(); |
693 | 694 | |
… |
… |
function wp_get_associated_nav_menu_items( $object_id = 0, $object_type = 'post_ |
703 | 704 | ); |
704 | 705 | foreach( (array) $menu_items as $menu_item ) { |
705 | 706 | if ( isset( $menu_item->ID ) && is_nav_menu_item( $menu_item->ID ) ) { |
706 | | if ( get_post_meta( $menu_item->ID, '_menu_item_type', true ) != $object_type ) |
| 707 | if ( get_post_meta( $menu_item->ID, '_menu_item_type', true ) !== $object_type || |
| 708 | get_post_meta( $menu_item->ID, '_menu_item_object', true ) !== $taxonomy ) |
707 | 709 | continue; |
708 | 710 | |
709 | 711 | $menu_item_ids[] = (int) $menu_item->ID; |
… |
… |
function _wp_delete_post_menu_item( $object_id = 0 ) { |
741 | 743 | * @param int $object_id The ID of the original object being trashed. |
742 | 744 | * |
743 | 745 | */ |
744 | | function _wp_delete_tax_menu_item( $object_id = 0 ) { |
| 746 | function _wp_delete_tax_menu_item( $object_id = 0, $tt_id, $taxonomy ) { |
745 | 747 | $object_id = (int) $object_id; |
746 | 748 | |
747 | | $menu_item_ids = wp_get_associated_nav_menu_items( $object_id, 'taxonomy' ); |
| 749 | $menu_item_ids = wp_get_associated_nav_menu_items( $object_id, 'taxonomy', $taxonomy ); |
748 | 750 | |
749 | 751 | foreach( (array) $menu_item_ids as $menu_item_id ) { |
750 | 752 | wp_delete_post( $menu_item_id, true ); |