Show only the name and email, not who the account books for
CI / Tests (PHP 8.2) (pull_request) Successful in 42s
CI / PHPStan (pull_request) Successful in 2m56s
CI / Coding Standards (pull_request) Successful in 2m57s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m44s
CI / Tests (PHP 8.1) (pull_request) Successful in 53s
CI / No Debug Code (pull_request) Successful in 2s
CI / Build Plugin Zip (pull_request) Skipped
CI / Tests (PHP 8.2) (pull_request) Successful in 42s
CI / PHPStan (pull_request) Successful in 2m56s
CI / Coding Standards (pull_request) Successful in 2m57s
CI / Tests (PHP 8.3) (pull_request) Successful in 2m44s
CI / Tests (PHP 8.1) (pull_request) Successful in 53s
CI / No Debug Code (pull_request) Successful in 2s
CI / Build Plugin Zip (pull_request) Skipped
The block reports who is signed in and nothing more. Dropping the "Booking for …" line takes GuardianService with it — it was the only reason the page had a dependency at all, so AccountPage now constructs with no arguments. Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
@@ -3,7 +3,6 @@ declare(strict_types=1);
|
||||
|
||||
namespace Unsupervised\Schedular\Auth;
|
||||
|
||||
use Unsupervised\Schedular\Guardian\GuardianService;
|
||||
use Unsupervised\Schedular\Val;
|
||||
|
||||
/**
|
||||
@@ -15,8 +14,6 @@ use Unsupervised\Schedular\Val;
|
||||
*/
|
||||
class AccountPage {
|
||||
|
||||
public function __construct( private GuardianService $guardians ) {}
|
||||
|
||||
/**
|
||||
* Renders the account shortcode/block output.
|
||||
*
|
||||
@@ -55,16 +52,6 @@ class AccountPage {
|
||||
$name = UserName::format( $user, get_current_user_id() );
|
||||
$email = $user->user_email;
|
||||
|
||||
// Whose lessons this account books, when that is more than just their own.
|
||||
// A parent's first question on seeing "signed in as Grace" is whether this
|
||||
// is the account their children's lessons are on.
|
||||
$students = [];
|
||||
foreach ( $this->guardians->bookableStudents( get_current_user_id() ) as $student ) {
|
||||
if ( ! $student['is_self'] ) {
|
||||
$students[] = $student['name'];
|
||||
}
|
||||
}
|
||||
|
||||
// Back to where they were, so signing out of a header link does not also
|
||||
// navigate them somewhere. The login page is the better landing spot when
|
||||
// one is configured, since the current page may be members-only.
|
||||
|
||||
Reference in New Issue
Block a user