0
votes

GravityForms has a simple action hook that can be used after submission

add_action( 'gform_after_submission', 'my_function', 10, 2 );

my_function is any user-defined function where the call reaches if the action hook is found in functions.php

StickyList, an add-on built on GravityForms also provides an action hook that can be used after the form is submitted. It is here below

add_action("gform_after_submission", array($this, "post_edit_entry"), 10, 2);

My question is, how does one use the my_function to the StickyList action hook which hasn't specified/documented how to use this action hook. I don't know what the array is doing as a second argument and how to get the call to reach my user defined function once this action_hook is found in functions.php.

1
just look at documentation before asking some question. there isn't any errors, and you don't need help. just want to know - use search engine/documentation of target: developer.wordpress.org/reference/functions/add_action - Samvel Aleqsanyan
array used because add_action calling class method post_edit_entry. - Samvel Aleqsanyan
The stickyList add_action hook after editing entry I found that worked was the following: add_action('stickylist_entry_edited','my_function', 10, 2 ); @Sam - veritas
@Samvel, I now uderstand what you are saying. It is adding a hook to the GravityForms Form Submission saying - go to post_edit_entry() after submitting form. What I don't understand is: post_edit_entry() has two parameters - $entry, $form. public function post_edit_entry($entry, $form) But add_action only sends $this inside the array How does post_edit_entry receive $entry and $form objects? - veritas

1 Answers

0
votes

The stickyList add_action hook after editing entry I found that worked was the following. Thanks Samvel for your help.

add_action('stickylist_entry_edited','my_function', 10, 2 );