elliotcondon/acf — pull request #280 by jenwachter (2014-05-28 15:24:02+00:00)
Title: Fixed small bug on selected posts in relationship field

When selecting items on the left side of the relationship field, they bump over to the right side with the correct post type assigned. However, when you come back at a later date to edit the post, items on the right side display the content type of the post being edited rather than their own post type.

To fix this, I used the post type of the current post (all selected posts are being looped through at this point) `$p->post_type` as the argument for `get_post_type_object()` instead of the global post's type.

_An example_

This is a relationship field on the `person` content type. As you can see "School of Arts and Science" is selected, but is displaying `person` as the content type instead of `division` as you can see in the left side is its correct content type.

![screen shot 2014-05-28 at 11 15 44 am](https://cloud.githubusercontent.com/assets/1202305/3106445/c40c665e-e67b-11e3-8ecf-5c66d5c6b365.png)