Skip to content

Commit

Permalink
= 4.2.2.4 =
Browse files Browse the repository at this point in the history
~ Fixed: access object via old ArrayAssess (removed)
  • Loading branch information
tungnxt89 committed Apr 3, 2023
1 parent 7416f77 commit 8bab173
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions inc/jwt/rest-api/version1/class-lp-rest-users-v1-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -685,12 +685,13 @@ public function get_course_tab_contents( $request ) {
)
);

if ( empty( $query_enrolled['items'] ) ) {
if ( empty( $query_enrolled->get_items() ) ) {
continue;
}

$items = $query_enrolled->get_items();
$enrolled_ids = array();
foreach ( $query_enrolled['items'] as $enrolled_item ) {
foreach ( $items as $enrolled_item ) {
$course_data = $user->get_course_data( $enrolled_item );

if ( $course_data ) {
Expand Down Expand Up @@ -731,8 +732,8 @@ public function get_course_tab_contents( $request ) {
);

$created_ids = array();
if ( ! empty( $query_created['items'] ) ) {
foreach ( $query_created['items'] as $created_item ) {
if ( ! empty( $query_created->get_items() ) ) {
foreach ( $query_created->get_items() as $created_item ) {
$created_ids[] = $created_item;
}
}
Expand Down Expand Up @@ -1151,17 +1152,20 @@ public function get_lp_data_tabs( $user, $request ): array {
'orders' => $this->get_order_content_tab( $request ),
);

/**
* @var LP_Profile_Tab $tab
*/
foreach ( $tabs->get() as $key => $tab ) {
$output[ $key ] = array(
'title' => $tab['title'] ?? '',
'slug' => $tab['slug'] ?? '',
'priority' => $tab['priority'] ?? '',
'icon' => $tab['icon'] ?? '',
'title' => $tab->get( 'title' ) ?? '',
'slug' => $tab->get( 'slug' ) ?? '',
'priority' => $tab->get( 'priority' ) ?? '',
'icon' => $tab->get( 'icon' ) ?? '',
'content' => $content[ $key ] ?? '',
);

if ( ! empty( $tab['sections'] ) ) {
foreach ( $tab['sections'] as $section_key => $section ) {
if ( ! empty( $tab->get( 'sections' ) ) ) {
foreach ( $tab->get( 'sections' ) as $section_key => $section ) {
$output[ $key ]['section'][ $section_key ] = array(
'title' => $section['title'] ?? '',
'slug' => $section['slug'] ?? '',
Expand Down

0 comments on commit 8bab173

Please sign in to comment.