Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cu 85ztkvkek qsm ultimate hooks #2685

Merged
merged 2 commits into from
Oct 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion php/admin/about-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
function qsm_generate_about_page() {
global $mlwQuizMasterNext;
$version = $mlwQuizMasterNext->version;
if ( ! current_user_can( 'moderate_comments' ) ) {
if ( ! current_user_can( 'delete_others_qsm_quizzes' ) ) {
return;
}
$tab_array = [
Expand Down
2 changes: 1 addition & 1 deletion php/admin/addons-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @since 4.4.0
*/
function qmn_addons_page() {
if ( ! current_user_can( 'moderate_comments' ) ) {
if ( ! current_user_can( 'delete_others_qsm_quizzes' ) ) {
return;
}

Expand Down
2 changes: 1 addition & 1 deletion php/admin/admin-dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function qsm_dashboard_screen_options( $status, $args ) {
*/
function qsm_generate_dashboard_page() {
// Only let admins and editors see this page.
if ( ! current_user_can( 'edit_posts' ) ) {
if ( ! current_user_can( 'edit_qsm_quizzes' ) ) {
return;
}
global $mlwQuizMasterNext;
Expand Down
2 changes: 1 addition & 1 deletion php/admin/stats-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @return void
*/
function qmn_generate_stats_page() {
if ( ! current_user_can('moderate_comments') ) {
if ( ! current_user_can('delete_others_qsm_quizzes') ) {
return;
}
global $mlwQuizMasterNext;
Expand Down
2 changes: 1 addition & 1 deletion php/admin/tools-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* @since 6.2.0
*/
function qsm_generate_quiz_tools() {
if ( ! current_user_can( 'moderate_comments' ) ) {
if ( ! current_user_can( 'delete_others_qsm_quizzes' ) ) {
return;
}
add_meta_box( 'qsm_restore_box', 'Restore Quiz', 'qsm_restore_function', 'quiz_wpss' );
Expand Down
10 changes: 5 additions & 5 deletions php/rest-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function qsm_register_rest_routes() {
'methods' => WP_REST_Server::CREATABLE,
'callback' => 'qsm_rest_create_question',
'permission_callback' => function () {
return current_user_can( 'edit_posts' );
return current_user_can( 'edit_qsm_quizzes' );
},
)
);
Expand All @@ -41,7 +41,7 @@ function qsm_register_rest_routes() {
'methods' => WP_REST_Server::EDITABLE,
'callback' => 'qsm_rest_save_question',
'permission_callback' => function () {
return current_user_can( 'edit_posts' );
return current_user_can( 'edit_qsm_quizzes' );
},
)
);
Expand Down Expand Up @@ -70,7 +70,7 @@ function qsm_register_rest_routes() {
'methods' => WP_REST_Server::EDITABLE,
'callback' => 'qsm_rest_save_results',
'permission_callback' => function () {
return current_user_can( 'edit_posts' );
return current_user_can( 'edit_qsm_quizzes' );
},
)
);
Expand All @@ -90,7 +90,7 @@ function qsm_register_rest_routes() {
'methods' => WP_REST_Server::EDITABLE,
'callback' => 'qsm_rest_save_emails',
'permission_callback' => function () {
return current_user_can( 'edit_posts' );
return current_user_can( 'edit_qsm_quizzes' );
},
)
);
Expand Down Expand Up @@ -123,7 +123,7 @@ function qsm_register_rest_routes() {
'methods' => WP_REST_Server::READABLE,
'callback' => 'qsm_rest_get_bank_questions',
'permission_callback' => function () {
return current_user_can( 'edit_posts' );
return current_user_can( 'edit_qsm_quizzes' );
},
)
);
Expand Down
Loading