[Resolved] Hook / action when I click on Publish

Home Forums Support [Resolved] Hook / action when I click on Publish

Home Forums Support Hook / action when I click on Publish

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1572075
    Jean-Pol

    Hello,
    I am new to wordpress hooks. I would like to accomplish something when I save on the publish button of an article. I can’t find the hook to use which would trigger just when clicking on the button to save / save an article.
    To test, I placed this code in function.php, but nothing appears:

    function example($post_ID)
    {
      echo '<script language="javascript">';
      echo 'alert(SAVED)'; 
      echo '</script>';
    }
    add_action('publish_post', 'example');

    I try many hook, like save_post, but no succes.

    #1572116
    Leo
    Staff
    Customer Support

    Hi there,

    The theme itself doesn’t deal with this side of things at all.

    I would recommend checking with the WordPress support team to see if they are able to help, or start a topic in a general WordPress website like this:
    https://wordpress.stackexchange.com/

    Thanks for your understanding and hope this helps ๐Ÿ™‚

    #1572436
    Jean-Pol

    Thanks Leo !

    #1573297
    Leo
    Staff
    Customer Support
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.