- This topic has 4 replies, 2 voices, and was last updated 6 months ago by .
-
Topic
-
Hello,
First of all, great plugin!
I am programatically creating relationships between users and posts but in the documentation it only appears possible to add one relationship at a time. I can acheive what I want to using a loop but it’s not good for performance. Is there a more appropriate way to acheive the following?
foreach($array_of_post_ids as $post_id) { MB_Relationships_API::add( $from = $user_id, $to = $post_id, $id = 'metabox_relationship_id', $order_from = 1, $order_to = 1 ); }
I would ideally like to pass in a single array of post ids but this doesn’t appear to work.
It’s not a big problem because my arrays are relatively small in size but would like to know if there is a better practice here? Even a hacky workaround would be better than a loop I feel.
Many thanks.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.