Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

I need help in implementing this bit of code WordPress

  • SOLVED

I am using post2post connection plugin.
1. I have two post type post_type_1 and post_type2.
2. Currently I can connect it manually by opening any of post_type.
3. But I have lots of posts so creating connecting manually is just not possible.
4. I have found this plugin has way but it above my pay grade so I need help.

See it here: https://github.com/scribu/wp-posts-to-posts/wiki/Creating-connections-programmatically

http://wordpress.stackexchange.com/questions/20566/how-to-programmatically-create-a-connection-with-plugin-posts-2-posts-on-cpt

So, I am thinking like that adding a unique to both post like spid001 to post_type_1 and id001 to post_type2.

If the the spid matches connect it :)

But I am unable to write the function. Let me know your thoughts on this. Thanks !

See this visually http://prnt.sc/ev8h15

Answers (2)

2017-04-11

Arnav Joy answers:

Hi ,
What connection you want to get ?


Jihan Ahmed comments:

you know the site. This plugin just connect two post type like sponsor and donor. Currently I create sponsor and donor post separately and then open any post sponsor and donor and using the plugin you can click on create connections and select the specific donor post to connect with that sponsor post. So, basically I need this done automated upon using any query.

Do you want me to sent the logins so you can see how it works although you know it?

2017-04-11

Cesar Contreras answers:

This will help:
Https://github.com/scribu/wp-posts-to-posts/wiki/Basic-usage