[Pro Forms] How to get {{live_post_id}} value using the bricks/form/custom_action hook?

Hello, everyone,

I’m trying to get the post ID ({{live_post_id}}) inside a Pro Forms “Custom” action, which uses the bricks/form/custom_action hook.

When I use the variable directly, it doesn’t seem to be processed. Instead of the actual post ID value, I receive the literal text “{{live_post_id}}”.

My goal is to pass this ID to my custom PHP code. Is there a specific function or method to retrieve the processed value of {{live_post_id}} within the function that runs on this hook?

Thanks in advance for your help.

Hey :slight_smile: First, its important that you`re using the hook “bricksforge/pro_forms/custom_action”.

You have access to the method get_live_post_id(). For example, if your argument has the name $form, you would write: $form->get_live_post_id().