Our Give forms are a custom post type like any other post type in WordPress. Here’s docs on WordPress’ built-in helper function get_post_type()
https://developer.ww.wp.xz.cn/reference/functions/get_post_type/
Other than that, I’d need to know a bit more about what you are trying to accomplish and potentially with sample code in order to be more helpful.
Thanks!
Actually i am trying to show a google recaptcha for a give specific form. So i need the current form id in functions.php file.
We have a sample snippet for implementing recaptcha. This is a global example though:
https://github.com/impress-org/give-snippet-library/blob/master/form-customizations/implement-recaptcha.php
If you need guidance implementing custom PHP functions on your website, we have this guide here: https://givewp.com/documentation/resources/adding-custom-functions-to-your-wordpress-website/
From there you could use a simple conditional along the lines of:
if ($post->ID == '123')
Where 123 is the form ID you want to target.
Give is extremely extensible in this way, and very flexible for experienced developers. While we can provide guidance and examples like this, we cannot provide a fully custom solution for you. I do trust however that the resources I’ve provided should enable you to get where you need to go.
Thanks, and best of luck!
If but i think $post->ID will show the current page id. The form is added to a wordpress page with shortcode and i want to get the current form id when i am on that page inside functions.php