Exemplo n.º 1
0
 /**
  * Uncompletes order
  *
  * @access public
  * @param int $ID
  * @return void
  */
 public static function uncompleteOrder($ID)
 {
     $relations = ThemexWoo::getRelatedPost($ID, array('course_product', 'plan_product'));
     if (!empty($relations)) {
         foreach ($relations as $related) {
             if ($related->post_type == 'course') {
                 ThemexCourse::removeUser($related->ID, $related->post_author, true);
             } else {
                 if ($related->post_type == 'plan') {
                     ThemexCourse::unsubscribeUser($related->ID, $related->post_author, true);
                 }
             }
         }
     }
 }