if ( $item->title
) { $item->post_title =
$item->title;
} // 'classes' should be an array, as in wp_setup_nav_menu_item().
if ( isset( $item->classes
) &&
is_scalar( $item->classes
) ) { $item->classes =
explode( ' ',
$item->classes
);
} $item->ID =
$this->post_id;
$item->db_id =
$this->post_id;
$post =
new WP_Post( (object) $item );
if ( empty( $post->post_author
) ) { $post->post_author =
get_current_user_id();
} if ( !
isset( $post->type_label
) ) { $post->type_label =
$this->
get_type_label( $post );
} // Ensure nav menu item URL is set according to linked object.
if ( 'post_type' ===
$post->type && !
empty( $post->object_id
) ) {