Changeset 27251
- Timestamp:
- 02/25/2014 12:50:36 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/nav-menu.php
r27220 r27251 277 277 * @param int $menu_item_db_id The ID of the menu item. If "0", creates a new menu item. 278 278 * @param array $menu_item_data The menu item's data. 279 * @return int The menu item's database ID or WP_Error object on failure.279 * @return int|WP_Error The menu item's database ID or WP_Error object on failure. 280 280 */ 281 281 function wp_update_nav_menu_item( $menu_id = 0, $menu_item_db_id = 0, $menu_item_data = array() ) { … … 285 285 // make sure that we don't convert non-nav_menu_item objects into nav_menu_item objects 286 286 if ( ! empty( $menu_item_db_id ) && ! is_nav_menu_item( $menu_item_db_id ) ) 287 return new WP_Error( 'update_nav_menu_item_failed', __('The given object ID is not that of a menu item.'));287 return new WP_Error( 'update_nav_menu_item_failed', __( 'The given object ID is not that of a menu item.' ) ); 288 288 289 289 $menu = wp_get_nav_menu_object( $menu_id ); 290 290 291 if ( ( ! $menu && 0 !== $menu_id ) || is_wp_error( $menu ) ) 291 if ( ! $menu && 0 !== $menu_id ) { 292 return new WP_Error( 'invalid_menu_id', __( 'Invalid menu ID.' ) ); 293 } 294 295 if ( is_wp_error( $menu ) ) { 292 296 return $menu; 297 } 293 298 294 299 $defaults = array(
Note: See TracChangeset
for help on using the changeset viewer.