Put the add_filter() call in the init function:
public function init(){
parent::init();
add_filter("gform_submit_button", array($this, "form_submit_button"), 10, 2);
add_filter("gform_confirmation", array( $this, 'custom_confirmation' ), 10, 4 );
}
And then add your custom_confirmation() function as a method to the class:
class GFSimpleAddOn extends GFAddOn {
/* all the other properties and methods */
public function custom_confirmation($confirmation, $form, $lead, $ajax){
$gfe = $lead['id'];
// rest of your code
}
}
Related Posts:
- Inserting Gravity Form checkbox values into Advanced Custom Fields [closed]
- Using file_get_contents with Gravity Forms uploads folder to create images in the media library returning false
- How do I dynamically populate a shortcode with a variable from URL?
- Capture User Email Address When Filling Out Form
- Function to capture a value and store it in a variable
- Keyword checking in Gravity Forms
- Gravity form built in Captcha
- How do I limit the number of forms a user can create in gravity forms?
- Using data sent via AJAX in multiple functions on a WP plugin
- Logic on a Gravity Forms redirect [closed]
- PHP -> SQL Query with Summing
- Gravity Forms merge tags in templates?
- using shortcodes inside gravity forms
- Dynamically populate parameter in Gravity Forms using PHP
- Remove an action created by a Gravity Forms add-on
- Updating user meta adds string count to value?
- Gravity Forms: How to add PHP function to confirmation conditional shortcode?
- Trouble Accessing Gravity Forms API (GFAPI)
- Confuse between forms and tables
- How to get current post id in gform_field_validation gravity forms
- add ‘publish metabox’ to Gravity forms edit page/form area
- Run htmlentities() on all submitted values through gravity forms
- Attaching an upload to a user
- Gravity Forms on submit return value on same page
- media_handle_upload fails with gravity form submitted image
- Gravity Forms Marketo Plugin Feed [closed]
- Adding Gravity Form With if(is_page) Is Not Working
- Gravity Forms – Prevent Multiple Form Entries Same User ID with Same Field Value
- Sending the reset password link programatically
- How to change upload directory in wp_handle_upload
- Only show div on homepage/blog index in wordpress/php
- Calculate percentage of post by category
- the_title() & the_content() are retrieving Post details inside a Page, after calling a shortcode
- register_rest_route regex option for base64 or alternate
- Select dropdown not showing selected value php
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- Customized title tag for each page in pagination?
- Can is_page() be combined with a switch control structure?
- is it possible to force wordpress to always save thumbnails as ‘jpg’ not ‘png’
- Run a filter when a walker runs
- WordPress (3.9.1) MultiSite Permissions. Is chown the answer?
- have_posts() execution failure
- WordPress with php 5.5 and zend opcache
- Display fields as values in array from external SQL DB
- my posts are saved as drafts
- How can I remove a function that has been added to wordpress with add_filter?
- Create a range slider to change font-size with different screens sizes in wordpress customizer api
- Are there security or other issues with changing PHP time limit and max input vars?
- How can I pass a custom/dynamic product to the Woocommerce cart?
- Adding Taxonomy Image to taxonomy loop [closed]
- Irregular TTFB and server wait time response
- How to get private property in parent class into extended class?
- Loop stopped working
- How does WordPress differentiate what scripts are loaded in wp_head() and wp_footer()?
- Download PDF after CF7 form submission
- 3 different times on my WordPress website
- Flexslider won’t work on WordPress
- Unable to Find Space in Custom Function
- Simple WordPress endpoint route doesn’t work
- Is it possible to create new user from external form using REST API?
- HTML dropdown setting not showing last saved value in the database
- Show the section only if custom taxonomy was chosen
- How do I make this Metabox show current DB value?
- Limit posts when visited with mobile devices
- Unable to Call More than One Meta Box Output
- Make a page (url) not cacheable [closed]
- Most viewed posts in WordPress
- Is there a (offical) way for a theme to deactivate itself and show a message in admin?
- Trying to load category thumbnails on wordpress page
- Insert PHP code in Text
- Dropdown category field inside repeatable metabox
- How to extend SelectControl with data from my theme
- Retrieve alt text by referencing the img src
- var_dump() and print_r() display null in php
- Delete post meta by serialized meta value
- How to get a post’s attached media (audio) ID and insert it into rtmedia shortcode
- Create a temporal post
- add custom link to gallery images
- How can I copy an ACF field to AIOSEO field? [closed]
- How to find php variable of wordpress theme settings
- how to call other plugins once custom post has been inserted
- I was wondering if it’s possible to implement card.js on WordPress
- Ajax call URL 404’ing when pushed to staging server
- Modify arguments for parent theme’s `wp_register_style` via child theme
- WordPress Rewrite Issue
- Replace content in WordPress Page after GET from php page
- How to Publish WP original Source metabox value on front-end webpage
- How to wrap a text with shortcode into php file?
- error with WP custom form
- How to edit the default database of WordPress [closed]
- how to use header function in wp-load.php file [closed]
- changed front-page template gives 500 error
- PHP Syntax getting PHP terms
- How to create categories out of a list of words?
- Difference between php memory limit and wp memory limit?
- Add default block css when the block has been added with php?
- How to initialise WP_Query on the basis of a specific meta_value and continue iterating rest?
- Custom Post Type doesn’t have template content when creating programmatically in PHP but does when created in WP Admin
- how can i link threejs in my functions.php file in understrap theme
- WordPress / PHP: Check if column has value and then check if value in array