After_submissions hook does not work

I am adding a new file and folder inside wp-plugins with the code below, but it is not working:

<?php add_action('gform_after_submission', 'after_submission', 10, 2); function after_submission($entry, $form) { $url = ''; $info = [ 'name' => $entry[1], ]; $args = [ 'method' => 'POST', 'body' => $info, ]; wp_remote_post($url, $args); what can I do?

Hi Francisco. Adding that to a file and a folder inside wp-plugins is not correct. This is PHP code that can be added to your theme functions.php file, or you can use a plugin such as this one to keep the code separate from the theme: Code Snippets – WordPress plugin |

Please see this article for additional information on placing PHP snippets:

That information applies to your placement of the code using gform_after_submission. Thank you.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.