From f09967e1e8b75933add6e3b4f9ea9af36fca141c Mon Sep 17 00:00:00 2001 From: randhirexpresstech Date: Wed, 3 Apr 2024 13:35:49 +0530 Subject: [PATCH] fixed undefined constant SECURE_AUTH_COOKIE due to current_user_can function --- mlw_quizmaster2.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mlw_quizmaster2.php b/mlw_quizmaster2.php index 2a10b59bb..e3cbafc09 100644 --- a/mlw_quizmaster2.php +++ b/mlw_quizmaster2.php @@ -191,7 +191,8 @@ private function load_dependencies() { include_once 'php/classes/class-qsm-audit.php'; $this->audit_manager = new QSM_Audit(); - if ( is_admin() ) { + // In block editor api call is_admin return false so use qsm_is_admin. + if ( is_admin() || ( ! empty( $_POST['qsm_block_api_call'] ) && $this->qsm_is_admin() ) ) { include_once 'php/admin/functions.php'; include_once 'php/admin/stats-page.php'; include_once 'php/admin/quizzes-page.php';