$atts Shortcode or block attributes. */ public function render( array $atts ): string { if ( ! is_user_logged_in() ) { $permalink = get_permalink(); return sprintf( '

%s %s.

', esc_html__( 'Please', 'unsupervised-schedular' ), esc_url( wp_login_url( false === $permalink ? '' : $permalink ) ), esc_html__( 'log in to enrol in a class', 'unsupervised-schedular' ) ); } if ( ! current_user_can( RoleManager::CAP_BOOK_LESSON ) ) { return '

' . esc_html__( 'This page is for students only.', 'unsupervised-schedular' ) . '

'; } wp_enqueue_style( 'us-scheduler' ); wp_enqueue_script( 'us-scheduler-group' ); $offeringId = absint( Val::int( $atts['offering'] ?? $atts['offeringId'] ?? 0 ) ); // Who this account may enrol — children first, the account holder last, so // a guardian's default choice is a child rather than themselves. $students = $this->guardians->bookableStudents( get_current_user_id() ); ob_start(); include USC_PLUGIN_DIR . 'templates/frontend/group-classes-page.php'; return (string) ob_get_clean(); } }