public static function removeAbandonedPosts() {
    $sub_posts = \SubPost::getWhere(array('post_parent' => 0));
    foreach($sub_posts as $sp) {
      wp_delete_post($sp->ID, true);
    }
  }
public static function removeAbandonedPosts() {
    $sub_posts = \SubPost::getWhere(array('post_parent' => 0));
    foreach($sub_posts as $sp) {
      wp_delete_post($sp->ID, true);
    }
  }
public static function removeAbandonedPosts ( ) { $ sub_posts = \ SubPost :: getWhere ( array ( 'post_parent' => 0 ) ) ; foreach ( $ sub_posts as $ sp ) { wp_delete_post ( $ sp -> ID , true ) ; } }
without hitting the publish or update button
without hitting the publish or update button