Skip to content

Commit

Permalink
Fixed category's parent issue
Browse files Browse the repository at this point in the history
  • Loading branch information
iam-pranav committed Jun 26, 2024
1 parent ec8e3ef commit 6682940
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions php/classes/class-qsm-questions.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public static function get_question_categories_from_term_ids( $term_ids ) {
$categories_names[ $tax->term_id ] = $tax->name;
$taxs[ $tax->parent ][] = $tax;
}
$categories_tree = self::create_terms_tree( $taxs, $taxs[0] );
$categories_tree = self::create_terms_tree( $taxs, isset( $taxs[0] ) ? $taxs[0] : reset( $taxs ) );
}
$categories = array(
'list' => $categories_names,
Expand Down Expand Up @@ -527,7 +527,7 @@ public static function get_question_categories( $question_id = 0 ) {
$categories_names[ $tax->term_id ] = $tax->name;
$taxs[ $tax->parent ][] = $tax;
}
$categories_tree = self::create_terms_tree( $taxs, $taxs[0] );
$categories_tree = self::create_terms_tree( $taxs, isset( $taxs[0] ) ? $taxs[0] : reset( $taxs ) );

}
}
Expand Down

0 comments on commit 6682940

Please sign in to comment.