WordPress function is not called and ajax return 0
Instead of url: ajaxurl + “?action=fdiAddFavorite”,, use two lines like this: url: ajaxurl, action: “fdiAddFavorite”, Then at the end of fdiAddFavorite(), you try something like this: echo $favorite_list; // could also send message like “success!” wp_die();