From dd071ee27838ddcbf8d368fb1a8e275c6484fba6 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 15 Aug 2020 13:44:00 +0000 Subject: [PATCH] Menus: Make the `$object_id` parameter of `_wp_delete_post_menu_item()` required, for consistency with `_wp_delete_tax_menu_item()`. The function is private (only intended for core usage) and is hooked to the `delete_post` action, which always passes a non-zero post ID. Follow-up to [14295], [48794]. See #50343. git-svn-id: https://develop.svn.wordpress.org/trunk@48795 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/nav-menu.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/nav-menu.php b/src/wp-includes/nav-menu.php index 220f250e0b..f7ceb7cf2b 100644 --- a/src/wp-includes/nav-menu.php +++ b/src/wp-includes/nav-menu.php @@ -1038,7 +1038,7 @@ function wp_get_associated_nav_menu_items( $object_id = 0, $object_type = 'post_ * * @param int $object_id The ID of the original object being trashed. */ -function _wp_delete_post_menu_item( $object_id = 0 ) { +function _wp_delete_post_menu_item( $object_id ) { $object_id = (int) $object_id; $menu_item_ids = wp_get_associated_nav_menu_items( $object_id, 'post_type' );