Skip to content

Commit

Permalink
Merge pull request #2685 from QuizandSurveyMaster/CU-85ztkvkek-qsm-ul…
Browse files Browse the repository at this point in the history
…timate-hooks

Cu 85ztkvkek qsm ultimate hooks
  • Loading branch information
zubairraeen authored Oct 23, 2024
2 parents 28d7f13 + e41d8f3 commit de7e521
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
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

0 comments on commit de7e521

Please sign in to comment.