From 9df1092549b7bcf9718e257a0eb0addb3fadaa87 Mon Sep 17 00:00:00 2001 From: Tetrakern <26898880+Tetrakern@users.noreply.github.com> Date: Sat, 16 Nov 2024 01:16:53 +0100 Subject: [PATCH] Add login status bookshelf error messages --- includes/functions/users/_checkmarks.php | 4 ++++ includes/functions/users/_follows.php | 4 ++++ includes/functions/users/_reminders.php | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/includes/functions/users/_checkmarks.php b/includes/functions/users/_checkmarks.php index d5a58912..0fe8b0db 100644 --- a/includes/functions/users/_checkmarks.php +++ b/includes/functions/users/_checkmarks.php @@ -240,6 +240,10 @@ function fictioneer_ajax_get_finished_checkmarks_list() { // Validations $user = fictioneer_get_validated_ajax_user(); + if ( ! is_user_logged_in() ) { + wp_send_json_error( array( 'error' => 'You must be logged in.' ) ); + } + if ( ! $user ) { wp_send_json_error( array( 'error' => 'Request did not pass validation.' ) ); } diff --git a/includes/functions/users/_follows.php b/includes/functions/users/_follows.php index c6142733..1942be93 100644 --- a/includes/functions/users/_follows.php +++ b/includes/functions/users/_follows.php @@ -395,6 +395,10 @@ function fictioneer_ajax_get_follows_list() { // Validations $user = fictioneer_get_validated_ajax_user(); + if ( ! is_user_logged_in() ) { + wp_send_json_error( array( 'error' => 'You must be logged in.' ) ); + } + if ( ! $user ) { wp_send_json_error( array( 'error' => 'Request did not pass validation.' ) ); } diff --git a/includes/functions/users/_reminders.php b/includes/functions/users/_reminders.php index 517b8591..245c1863 100644 --- a/includes/functions/users/_reminders.php +++ b/includes/functions/users/_reminders.php @@ -167,6 +167,10 @@ function fictioneer_ajax_get_reminders_list() { // Validations $user = fictioneer_get_validated_ajax_user(); + if ( ! is_user_logged_in() ) { + wp_send_json_error( array( 'error' => 'You must be logged in.' ) ); + } + if ( ! $user ) { wp_send_json_error( array( 'error' => 'Request did not pass validation.' ) ); }