Skip to content

Commit

Permalink
Fix author access for scheduled chapters
Browse files Browse the repository at this point in the history
  • Loading branch information
Tetrakern committed Jan 13, 2025
1 parent b5450f6 commit da1b854
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion includes/functions/_setup-wordpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit da1b854

Please sign in to comment.