1

I'm trying to use add_to() in the latest version of Pods (2.3.18) and it doesn't seems to be creating the relationship in the database table (wp_postmeta). What I'm doing is:

$postPod = pods("post", $post_id);

$postPod->add_to("field", "valueID");

But the meta_key "field" doesn't appear in the database table.

How can I properly use this add_to function? I didn't find any examples in the documentation.

ninina31
  • 21
  • 5
  • Add_to should return the value of the post it was added to. Please check that it returns the correct ID, which it should, presuming $post_id was set properly. – JPollock Mar 19 '14 at 15:09
  • @JPollock It does. It seems that the function is not doing anything... How can I check if it does? Which database table is holding this information? Because in wp_postmeta I can't find it. – ninina31 Mar 20 '14 at 19:27
  • This article explains how relationship fields are stored http://pods.io/docs/database-reference/database-storage-relationship-fields/ You should check if add_to is creating new posts. If so that means that $pods_id does not have the right ID in it, as add_to will create a new item if the ID its trying to add to doesn't exist. – JPollock Mar 20 '14 at 21:08

0 Answers0