From c529d1158e8046b19f6ffacbd20c09cba85593d2 Mon Sep 17 00:00:00 2001 From: ren <18050944+renintw@users.noreply.github.com> Date: Mon, 23 Sep 2024 20:30:30 +0800 Subject: [PATCH] Fix uncaught error: call to a member function get_status(). --- wp-content/themes/pub/wporg-learn-2024/inc/block-hooks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-content/themes/pub/wporg-learn-2024/inc/block-hooks.php b/wp-content/themes/pub/wporg-learn-2024/inc/block-hooks.php index 6826af6bb..73b77ddea 100644 --- a/wp-content/themes/pub/wporg-learn-2024/inc/block-hooks.php +++ b/wp-content/themes/pub/wporg-learn-2024/inc/block-hooks.php @@ -182,7 +182,7 @@ function is_quiz_ungraded() { $user_id = get_current_user_id(); $quiz_progress = Sensei()->quiz_progress_repository->get( $quiz_id, $user_id ); - if ( 'ungraded' === $quiz_progress->get_status() ) { + if ( $quiz_progress && 'ungraded' === $quiz_progress->get_status() ) { return true; }