コード例 #1
0
 /**
  * Trigger flood notification if necessary and return IDs that should
  * receive a regular comment notification.
  *
  * @return array
  */
 function control_recipient_ids()
 {
     $site_comments = new Prompt_Site_Comments();
     $site_recipient_ids = $site_comments->subscriber_ids();
     $comment_author_id = $this->comment->user_id;
     if (!$comment_author_id) {
         $author = get_user_by('email', $this->comment->comment_author_email);
         $comment_author_id = $author ? $author->ID : null;
     }
     $post_author_recipient_ids = array();
     if (Prompt_Core::$options->get('auto_subscribe_authors')) {
         $post_author_recipient_ids = array($this->prompt_post->get_wp_post()->post_author);
     }
     $post_recipient_ids = array_diff($this->prompt_post->subscriber_ids(), array($comment_author_id));
     if ($this->is_flood()) {
         $this->prompt_post->set_flood_control_comment_id($this->comment->comment_ID);
         $this->unsubscribe($post_recipient_ids);
         $this->send_notifications($post_recipient_ids);
         return $this->all_ids_except($comment_author_id, $site_recipient_ids, $post_author_recipient_ids);
     }
     return $this->all_ids_except($comment_author_id, $site_recipient_ids, $post_author_recipient_ids, $post_recipient_ids);
 }
コード例 #2
0
ファイル: site-comments.php プロジェクト: postmatic/beta-dist
 /**
  * @since 1.0.0
  * @return array
  */
 public static function all_subscriber_ids()
 {
     // Currently just the default site comments subscribers
     $site = new Prompt_Site_Comments();
     return $site->subscriber_ids();
 }