Ajax handling in Elementor widget

Viewed 1099

How to get an ajax request in the context of a class that extends from \Elementor\Widget_Base. The problem is that the widget is registered later on the "elementor/widgets/widgets_registered" hook, later on the hook responsible for registering ajax requests in wordpress.

Obviously, I can create a file in my plugin to connect it and process ajax requests in it, but I would like to implement this task within the widget class, how can I do this? I suspect there is a hook for this in the elementor, but I can't find it :)

1 Answers

I know it's not what you are looking for, but in my case changing "elementor/widgets/widgets_registered" to "init" hook solved that problem. Eventually init hook register widgets as well

Related