Skip to content

Conversation

@ajoah
Copy link

@ajoah ajoah commented Jan 3, 2017

Hi,

If i try to connect posts from array which contains same post multiple time, only the first post is connected.

Exemple :

$posts = [
object(WP_Post) { 
 ['ID'] => 1,
 [...]
},
object(WP_Post) { 
 ['ID'] => 1,
 [...]
}
]
p2p_type( 'movies_to_actors' )->each_connected( $posts, array(), 'actors' );

var_dump($posts)  => [
object(WP_Post) { 
 ['ID'] => 1,
 ['actors'] => [...]
 [...]
},
object(WP_Post) { 
 ['ID'] => 1,
 [...]
}
]

The second post should have an actors attribute.

This pull request fixes this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant