Home › Forums › Calendar Products › Events Calendar PRO › Update custom event meta
- This topic has 3 replies, 2 voices, and was last updated 10 years, 1 month ago by
George.
-
AuthorPosts
-
March 11, 2016 at 12:02 pm #1087905
helloheathergraham
ParticipantI have a site where events are created programmatically using gravity forms (modified using this). Everything works great EXCEPT I just can’t figure out how to update custom meta/additional fields using this method. The only thing I have successfully been able to do is update the meta as if it were “just” a custom wordpress post (it displays on the bottom of the post edit like standard custom meta. It does NOT register as an additional field in ECP. I understand that this is probably beyond the scope of support but I would love if you have any advice or could point me in the right direction.
Note: I have reviewed functions relating to custom meta but they all seem to work around querying it vs updating it
March 11, 2016 at 12:21 pm #1087916George
ParticipantHey there,
This is indeed, and unfortunately, outside the scope of support we can provide here. π
I would recommend contacting the author of that script for assistance here.
One resource we have that might help is this list of all of the meta keys and names for our various Custom Fields β https://theeventscalendar.com/knowledgebase/wordpress-post-meta-data/
That might be handy.
Also, you mention finding functions for querying custom meta but not updating itβone thing that might help, then, is this function specifically made for updating meta β https://codex.wordpress.org/Function_Reference/update_post_meta
Let me know what thoughts you have about this and if there is anything else we can try to help with!
Sincerely,
GeorgeMarch 16, 2016 at 11:06 am #1089829helloheathergraham
ParticipantHello! Thank you for your guidance. I had actually already tried using update_post_meta but it wasn’t saving as an additional field in ECP. It was just saving as custom meta for a wordpress post (my understanding is that these aren’t exactly the same thing). This would have been totally fine except anytime I updated the post I would lose the value of the custom meta.
It turns out the filter I was using for save_post (for ECP posts) wasn’t checking for meta and therefore was erasing any saved meta values. I just needed to modify it and now it works!
Thanks again for your help!
March 16, 2016 at 2:55 pm #1090021George
ParticipantGlad to hear it! π
Best of luck with your site,
George -
AuthorPosts
- The topic ‘Update custom event meta’ is closed to new replies.
