function wp_update_nav_menu_item( $menu_id = 0,
$menu_item_db_id = 0,
$menu_item_data = array
(),
$fire_after_hooks = true
) { $menu_id =
(int) $menu_id;
$menu_item_db_id =
(int) $menu_item_db_id;
// Make sure that we don't convert non-nav_menu_item objects into nav_menu_item objects.
if ( !
empty( $menu_item_db_id ) && !
is_nav_menu_item( $menu_item_db_id ) ) { return new WP_Error( 'update_nav_menu_item_failed',
__( 'The given object ID is not that of a menu item.'
) );
} $menu =
wp_get_nav_menu_object( $menu_id );
if ( !
$menu && 0 !==
$menu_id ) { return new WP_Error( 'invalid_menu_id',
__( 'Invalid menu ID.'
) );
} if ( is_wp_error( $menu ) ) { return $menu;
}