Merge pull request 'Hide the My Lessons menu for users who already see Scheduler' (#86) from fix/hide-my-lessons-menu into main
CI / Tests (PHP 8.1) (push) Successful in 40s
CI / Coding Standards (push) Successful in 2m46s
CI / No Debug Code (push) Successful in 2s
CI / Tests (PHP 8.2) (push) Successful in 41s
CI / PHPStan (push) Successful in 2m44s
CI / Tests (PHP 8.3) (push) Successful in 2m36s
CI / Build Plugin Zip (push) Successful in 2m43s
CI / Tests (PHP 8.1) (push) Successful in 40s
CI / Coding Standards (push) Successful in 2m46s
CI / No Debug Code (push) Successful in 2s
CI / Tests (PHP 8.2) (push) Successful in 41s
CI / PHPStan (push) Successful in 2m44s
CI / Tests (PHP 8.3) (push) Successful in 2m36s
CI / Build Plugin Zip (push) Successful in 2m43s
Reviewed-on: #86
This commit was merged in pull request #86.
This commit is contained in:
+15
-10
@@ -233,16 +233,21 @@ class AdminMenu {
|
||||
30.5
|
||||
);
|
||||
|
||||
// Instructor: view their upcoming lessons.
|
||||
add_menu_page(
|
||||
__( 'My Lessons', 'unsupervised-schedular' ),
|
||||
__( 'My Lessons', 'unsupervised-schedular' ),
|
||||
RoleManager::CAP_VIEW_LESSONS,
|
||||
'us-my-lessons',
|
||||
[ $this->lessonController, 'renderInstructorLessons' ],
|
||||
'dashicons-welcome-learn-more',
|
||||
42
|
||||
);
|
||||
// Instructor: view their upcoming lessons. Hidden for anyone who can
|
||||
// already see the Scheduler — it shows every instructor's lessons
|
||||
// (including their own, with the same payment edit forms), so the two
|
||||
// menu items would just duplicate each other for an owner-operator.
|
||||
if ( ! current_user_can( RoleManager::CAP_VIEW_ALL_LESSONS ) ) {
|
||||
add_menu_page(
|
||||
__( 'My Lessons', 'unsupervised-schedular' ),
|
||||
__( 'My Lessons', 'unsupervised-schedular' ),
|
||||
RoleManager::CAP_VIEW_LESSONS,
|
||||
'us-my-lessons',
|
||||
[ $this->lessonController, 'renderInstructorLessons' ],
|
||||
'dashicons-welcome-learn-more',
|
||||
42
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user