guard_staff(); if ( $check ) { return $check; } try { $request = new \WP_REST_Request( 'GET', '/booktics/v1/team-members/profile' ); $controller = new \Booktics\Team_Member\Controllers\Team_Member_Controller(); $profile = $this->extract_response( $controller->get_profile( $request ), 'Failed to retrieve your schedule.' ); if ( isset( $profile['error'] ) ) { return $profile; } return $this->shape_team_member( $profile, true ); } catch ( \Throwable $e ) { Log::error( 'Booktics_Get_My_Schedule_Tool error', [ 'error' => $e->getMessage() ] ); return [ 'error' => 'Failed to retrieve your schedule: ' . $e->getMessage() ]; } } }