You are currently using an anonymous function. The first step would be changing it to a named function so you can retrieve it from the wp_filter
global array, which holds all the registered actions and filters. You’d do it like this:
function payment_test($form, $entry_id){
if ( function_exists( 'gf_webhooks' ) ) {
$entry = GFAPI::get_entry( $entry_id );
gf_webhooks()->maybe_process_feed( $entry, $form );
gf_feed_processor()->save()->dispatch();
}
}
add_action( 'gform_post_payment_completed', 'payment_test', 10, 2 );
// Call it manually by getting the callable from the wp_filter global.
global $wp_filter;
call_user_func_array(
$wp_filter['gform_post_payment_completed']->callbacks[10]['payment_test']['function'],
$args // You have to manually provide the arguments as an array.
);
Related Posts:
- Can an action callback prevent the parent from continuing execution?
- Update media library image shown in “attachment details” when using wp_insert_attachment to add item to the media library
- Gravity Forms parameters return 1
- Remove parent theme action in child
- How to do_action and get a return value?
- When is admin_init Action ran?
- How do I enqueue a script to run inside the Gutenberg editor?
- How can I find out what functions are assigned to actions?
- Disable WooCommerce action
- How can I remove the WP menu from the admin bar?
- Why, Where, and When to use reference pointers in filters/hooks?
- add_action customize_register not working
- Passing arguments into ‘init’ function
- Add a Custom Field in Comment Box AFTER text area BUT BEFORE Send button
- How to remove an action that is added inside a class
- Having an add_action( ‘user_new_form’,) [closed]
- How to remove an action added by a child theme of Genesis
- How to add a checkbox inside the “Publish post” widget?
- What’s the usage of action do_meta_boxes?
- How can I invoke an action after a CiviCRM triggering event?
- Custom bulk actions in WP 3.7.1
- Remove action from a plugin class
- how can I use add_action with external class which the function contain 2 argument?
- remove_action not working with procedural function
- Woocommerce Change placement with wrapper
- Modify query in pre_get_posts action is messing up my nav menu
- Exclude trash from save_post
- array of objects to do_action, callback gets singular object?
- Preventing frontpage to be deleted/moved to trash
- Selectively applying action based on role
- How to remove a custom action on child theme?
- Action hook on only publishing post not on editing or updating
- how can I use add_action run another function when publishing new post?
- How to remove function?
- Performance : Duplicating `add_action`
- add_action in class and use it in theme
- How to track post number on the_loop
- Better action hook for creating table than after_switch_theme and switch_theme action hook
- $GLOBALS[‘hook_suffix’] variable empty
- publish_post action hook not working
- add_action() in switch statement
- Problem with get_the_excerpt when using an add_action(‘the_content’) containing script tags
- add_action and do_action: multiple calls to same callback?
- Gutenberg – Dispatch action or setAttributes() on Post Save/Update action instead of onChange listener
- Shortcodes — Using add_action, add_filter in the shortcode
- Using Nested add_action()
- WordPress action admin_post for non-admin authenticated users – Form submission
- Instantiating classes through add_action and saving them to user_meta data [closed]
- Are the hooks in the dashboard such as “load-$page_slug$” and “admin-head-$page_slug$” reliable and consistent throughout installs?
- how to add submenu item under parent menu item with code
- add_action and do_action
- How to call a static function in add_action() inside another static function?
- Add “add to cart” button in WooCommerce [closed]
- Call do_action class’s function
- cannot filter after using pre_get_posts
- Generate payment URL in custom email [closed]
- missing argument 2 when passing arguments to add_action
- is there an update_post_meta action
- comment_post callback function: how to run it in the background.
- Add new users to “add new user” page on admin’s dashboard
- W3TC manual cache flush does not work
- Run a function on all posts
- Remove an action added within a class in a WordPress plugin
- add_action( ‘publish_pelicula’, ‘post_published_notification’, 10, 2 ); does not trigger propperly
- add_action.. will work if function is empty?
- save_post not triggered when a post is updated
- Action ‘init’ function doesn’t return variable
- Trying to write a function in an external php file to manage admin menu visibility
- Insert Google authorship into WordPress header
- add_action before theme setup
- How can I get the user that publishes a post?
- Action inside another action not working
- add_action which contains first argument admin_print_scripts-$page
- How can I get more out of `$post` in an `add_action` callback?
- How to use add_action inside files included by theme’s functions.php
- do_action in API call
- Add Tag to post after publishing
- Remove action not working in child theme
- Call to Action Button – Resize Help [closed]
- How do I dequeue js/css at the last possible moment?
- Translate are not working for standard admin
- wpdb->insert creates duplicate rows
- add_action init breaks site on PHP 7.1
- Need data from two different actions
- Why is this require statement not working?
- Adapting functions from Genesis theme
- Adding add_action function
- action future_post returns wrong date
- XML Imported Custom Posts
- Hook into admin_notices after sending mail
- save_post action not firing when save
- WooCommerce wp_insert_post action firing on every save
- WordPress’ work or execution flow manipulating $wpdb
- How to enable/disable a hook with theme options
- Passing arguments in add_action inside search template
- Building WP Web App: Creating a Feed for post revisions
- Can admin_bar_menu or another action be used to modify the admin bar on the admin side?
- remove an action hook function on a plugin from a theme
- What is the first action or filter executed by wordpress?
- A way to see real changes of posts inside an action?