[Plugin: Posts 2 Posts] Setting direction for each_connected()
-
Hi scribu,
I’ve been learning your plugin the last few days. It seems to me that indeterminate connections with reciprocal => false may require a need to set the direction when using each_connected(), because find_direction() will default it to ‘from’. I modified the function and got it to work for my intended purpose: http://pastebin.com/3MkPWn2n
The changes I made are at lines 1, 10 and 20.I’m relatively new to WordPress plugin coding so let me know if I’m just using the plugin wrong. I understand that you can achieve the same thing using p2p_type()->set_direction()->get_connected() calls but I’m guessing that’s less efficient and a little more complex to implement.
A case where this might be useful is covered in http://ww.wp.xz.cn/support/topic/plugin-posts-2-posts-hwo-to-make-grandfather-father-son
Btw, thanks heaps for this plugin, it’s been super helpful!
Cheers
The topic ‘[Plugin: Posts 2 Posts] Setting direction for each_connected()’ is closed to new replies.