I´ve editted the post to try to make it clearer and used the “code” button.
It´s related to ACF because I created all my custom fields with it, and because I´m trying to follow this example:
http://www.advancedcustomfields.com/resources/field-types/relationship/