Esempio n. 1
0
 /**
  * Physically delete all posts by a specified user
  *
  * @param array $user_id
  * @return bool
  */
 public function deletePosts($h, $user_id = 0)
 {
     // TODO we should be able to do the delete in 1 step without retrieving records first
     if (!$user_id) {
         return false;
     }
     //$results = \Hotaru\Models\Post::getByAuthor($user_id);
     $results = \Hotaru\Models2\Post::getByAuthor($h, $user_id);
     if ($results) {
         foreach ($results as $r) {
             $h->post->id = $r->post_id;
             // used by other plugins in "post_delete_post" function/hook
             $this->deletePost($h);
         }
     }
     return true;
 }