wp_ajax_{action_name} not working in multi class
-
I have main class A(ex: dashboard), and 2 class B (ex: state),C (ex: city)… and create a callback action in class B/C.
In class A I call hooks function from class B,C
Ex: declare class and call hooksclass_state = new State(); class_state->hooks() // function hooks from class B/C function hooks(){ add_action('wp_ajax_state_change', array($this,'state_change')); }
When I send ajax I got message Bad request, the javascript is success enqueu, if I put above function in function.php it ok
Tks
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘wp_ajax_{action_name} not working in multi class’ is closed to new replies.