javascript onload calling a function of a plugin
I did not test this, but something like this should work. Edit the function all_js in your plugin file and add these lines: $.post(“/wp-admin/admin-ajax.php”, { idPost: $(“.post-read”).data(“id”), action: “read” }, function(response) { // Handle errors etc. }); You also need to ensure that the button data changes when the AJAX request is made. Here is … Read more