I've added an anonymous function to an elementor hook in order to process form data:
add_action('elementor_pro/forms/new_record', function ($record, $ajaxHandler) { the code... }), 10,2);
It works as expected, but can't seem to edit or remove this function now that it's registered!?
Maybe I should note that the code is added as a XYZ PHP-snippet that is called via shortcode. I don't know if that makes any difference?
I've tried the following:
remove_action('elementor_pro/forms/new_record','elementor_pro/forms/new_record',10);
remove_action('elementor_pro/forms/new_record',function ($record, $ajaxHandler{},10);
remove_all_actions('elementor_pro/forms/new_record');
(the remove_action functions were both added with an add_action handler).
I also restarted PHP, but the initial function seems to persist regardless. Any ideas. Where is this function even registered, can I remove it from the database somehow?
I'm running PHP Version 7.4 and WP 6.1.1.