WordPress.org

Support

Support » Plugins and Hacks » Hook for when comment added to blog post

Hook for when comment added to blog post

  • Hi,

    I’m trying to write a plugin that pops up a message window when a comment is posted to a blog post. At the moment I’m using the action hook

    add_action("wp_insert_comment", "function_name");
    
    function function_name(){
        echo "<script>
                  mywindow = window.open('http://www.twitter.com', ' ',     'width=300,height=500');
              </script>";
    }

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    When I post a comment to a blog post I expect the twitter window to pop up but nothing happens. Any help will be appreciated.

    Regards,

    Anthony

  • The topic ‘Hook for when comment added to blog post’ is closed to new replies.
Skip to toolbar