Getting the post ID of the page a form is on

I’m aware that there is a way to get the post ID of a post a form creates, however, that’s not what I want. I just want to get the post_ID of the page/post a form is on. I’m aware that I can create a hidden field and dynamically populate the field with the post ID. OK. That’s close. However, I would rather not rely on a hidden field to give me the post ID because I want to be able to get the post ID the same way every time, regardless of what form it is (so not having to write php that checks the value of some random field by ID - on some forms the field might have ID 13, others it might be ID 4. Is there really no other way to get the post ID of the page the form is on?

Thanks in advance.

Hi Rob,

From what I understand you should be able to accomplish this use case with Gravity Forms Populate Anything - Gravity Wiz and a filter to populate the current post ID.

I hope this helps!

Best,

1 Like

You can also set a default value of the field using the {embed_post} Merge Tag. To specifically populate the post ID, you would enter {embed_post:ID} as the default value.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.