I'm trying to create a very simple alert for each time a post is created or updated with the below...
add_action( 'save_post', 'updatedAlert' );
function updatedAlert() {
echo '<script>alert("post updated!");</script>';
}
The moment I drop this in I get "headers already sent" in both post.php and pluggable.php.
Am I missing something obvious? It seems like there shouldn't be anything else to it!
Any advice appreciated.