I am working on this project and I am trying to execute a jquery or javascript just before saving the post, I have tried the following:
function do_something_with_a_post($id) {
<script>alert('hello');</script>
}
add_action('pre_post_update', 'do_something_with_a_post');
but it gives a php error... I am really unsure on how to do this.
Does anyone has an idea? Thanks!
Aucun commentaire:
Enregistrer un commentaire