From da1b85435386f35a3d7331e0b50cdd12aaa1b544 Mon Sep 17 00:00:00 2001 From: Tetrakern <26898880+Tetrakern@users.noreply.github.com> Date: Mon, 13 Jan 2025 11:32:01 +0100 Subject: [PATCH] Fix author access for scheduled chapters --- includes/functions/_setup-wordpress.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/functions/_setup-wordpress.php b/includes/functions/_setup-wordpress.php index 87e1655f..ac82f886 100644 --- a/includes/functions/_setup-wordpress.php +++ b/includes/functions/_setup-wordpress.php @@ -1721,8 +1721,9 @@ function fictioneer_redirect_scheduled_chapter_404() { if ( isset( $wp_query->query_vars['p'] ) && ( $wp_query->query_vars['post_type'] ?? 0 ) === 'fcn_chapter' ) { $post_id = absint( $wp_query->query_vars['p'] ); $user_id = get_current_user_id(); + $author_id = (int) get_post_field( 'post_author', $post_id ); - if ( $user_id && $user_id === get_post_field( 'post_author', $post_id ) ) { + if ( $user_id && $user_id === $author_id ) { return; // Default behavior }