示例#1
0
 /**
  * Setup actions for methods in this class
  * @since JetpackComments (1.4)
  */
 protected function setup_actions()
 {
     parent::setup_actions();
     // Selfishly remove everything from the existing comment form
     remove_all_actions('comment_form_before');
     remove_all_actions('comment_form_after');
     // Selfishly add only our actions back to the comment form
     add_action('comment_form_before', array($this, 'comment_form_before'));
     add_action('comment_form_after', array($this, 'comment_form_after'));
     // Before a comment is posted
     add_action('pre_comment_on_post', array($this, 'pre_comment_on_post'), 1);
     // After a comment is posted
     add_action('comment_post', array($this, 'add_comment_meta'));
 }