index.php sayfası
<script></script>
<script></script>
$(document).ready(function () {
$('#p_button').click(function () {
let form = $('#test');
$.ajax({
url: '/wp-admin/admin-ajax.php',
method: 'POST',
data: form.serialize() + '&action=my_action',
success: function (data) {
console.log(data);
}
});
});
});