I want to make a post api call once a post or page is published/updated and show a javascript alert box saying ‘Post has been published/updated’
If you only want an alert then why do you write it in a separate file and enqueue it? You can directly write it inside the invoke_save_post function using echo “<script>alert(‘Api called’);</script>”; or if you want to write it in a separate file then you have to write your alert inside the function and call … Read more