jeudi 26 mai 2016

How to call the ajax function in my plugin file using wordpress?

I need to call the ajax call in my plugin . I have created plugin file .

My Plugin File :-

  class Wp_MYplugin{
        function __construct() {
            add_action( 'wp_ajax_my_ajax', 'my_ajax' );
        }

        function my_ajax(){
            echo "test";
        }
   }

Ajax call returns 0 . How can I fix this ?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire