WordPress.org

Ready to get started?Download WordPress

Forums

Hook for when comment added to blog post (1 post)

  1. fadyboy
    Member
    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

  • RSS feed for this topic
  • Started 1 year ago by minimundodelbebe
  • This topic is not resolved
  • WordPress version: 3.5.1