ajax for visitors wordpress
You also need to add your action callback to non-privileged users. It works the same way as you registered your my_action_callback – you just need to add another line. add_action( ‘wp_ajax_my_action’, ‘my_action_callback’ ); add_action( ‘wp_ajax_nopriv_my_action’, ‘my_action_callback’ ); Notice the wp_ajax_nopriv_ in front of your action – this tells WordPress that any user may call this … Read more