While I’ve figured out a plugin conflict and how to load the page ID inside gform_form_post_get_meta, I’ve noticed, that the get_queried_object_id() does not get passed along the way in other places in Wordpress. That means that on the frontend the ID and the meta query that loads from the ID gets loaded correctly. However, the form entry and entry notification (e-mail) does not included this data.
I tried to hardcode the ID inside my function, and everything worked correctly, so I believe the post ID does not get passed further than the front-end. Is this assumption correct? How can I load the post ID elsewhere (not frontend)?
gform_form_post_get_meta is intended to alter the $form object, it doesn’t provide any specific support for getting a post ID. Also there’s no information about post ID in the $form object.
So if you need the post ID for any reason, getting it is something you need to manage with your own code from WordPress side of things.
Hi @sacom ,
thank you for your reply. I’m also loading the post ID using a merge tag, and this loads correctly everywhere. Could you please share, how could I load this ID from the $form object (or using the merge tag) inside my php function?
thanks for the awesome information.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.