diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 2f9dcd79..94f952de 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -302,7 +302,7 @@ Fictioneer customizes WordPress by using as many standard action and filter hook | `user_has_cap` | `fictioneer_edit_only_comments` | `wp_list_comments_args` | `fictioneer_comment_list_args` | `wp_handle_upload_prefilter` | `fictioneer_upload_restrictions` -| `wp_insert_post_data` | `fictioneer_remove_restricted_block_content`, `fictioneer_strip_shortcodes_on_save` +| `wp_insert_post_data` | `fictioneer_remove_restricted_block_content`, `fictioneer_strip_shortcodes_on_save`, `fictioneer_see_some_evil` | `wp_is_application_passwords_available` | `__return_false` | `wp_robots` | `fictioneer_add_noindex_to_robots` | `wp_sitemaps_enabled` | `__return_false` diff --git a/single-fcn_chapter.php b/single-fcn_chapter.php index ef16fd98..c893b55c 100644 --- a/single-fcn_chapter.php +++ b/single-fcn_chapter.php @@ -25,6 +25,17 @@ if ( ! empty( $is_hidden ) ) { get_header( null, $header_args ); +// Draft or private (if caching is on)? +$post_status = get_post_status( $post_id ); + +if ( + fictioneer_caching_active() && + $post_status !== 'publish' && + ( $_GET['preview'] ?? 0 ) !== 'true' +) { + fictioneer_redirect_to_404(); +} + ?>
diff --git a/single-fcn_collection.php b/single-fcn_collection.php index a4f5bdcf..115e8bbe 100644 --- a/single-fcn_collection.php +++ b/single-fcn_collection.php @@ -15,7 +15,23 @@ */ ?> - + 'fcn_collection' ) ); + +// Draft or private (if caching is on)? +$post_status = get_post_status( $post_id ); + +if ( + fictioneer_caching_active() && + $post_status !== 'publish' && + ( $_GET['preview'] ?? 0 ) !== 'true' +) { + fictioneer_redirect_to_404(); +} + +?>
diff --git a/single-fcn_recommendation.php b/single-fcn_recommendation.php index 822605ca..5fd91a47 100644 --- a/single-fcn_recommendation.php +++ b/single-fcn_recommendation.php @@ -11,7 +11,23 @@ */ ?> - 'fcn_recommendation' ) ); ?> + 'fcn_recommendation' ) ); + +// Draft or private (if caching is on)? +$post_status = get_post_status( $post_id ); + +if ( + fictioneer_caching_active() && + $post_status !== 'publish' && + ( $_GET['preview'] ?? 0 ) !== 'true' +) { + fictioneer_redirect_to_404(); +} + +?>
diff --git a/single-fcn_story.php b/single-fcn_story.php index 73e2991f..4de24722 100644 --- a/single-fcn_story.php +++ b/single-fcn_story.php @@ -26,6 +26,17 @@ if ( ! empty( $is_hidden ) ) { get_header( null, $header_args ); +// Draft or private (if caching is on)? +$post_status = get_post_status( $post_id ); + +if ( + fictioneer_caching_active() && + $post_status !== 'publish' && + ( $_GET['preview'] ?? 0 ) !== 'true' +) { + fictioneer_redirect_to_404(); +} + ?>
diff --git a/single-post.php b/single-post.php index 6038f976..7e0d2d4e 100644 --- a/single-post.php +++ b/single-post.php @@ -8,7 +8,23 @@ */ ?> - +
diff --git a/singular-titleless.php b/singular-titleless.php index 5ccbf651..3bd11f34 100644 --- a/singular-titleless.php +++ b/singular-titleless.php @@ -9,7 +9,23 @@ */ ?> - +
diff --git a/singular.php b/singular.php index e0c9410b..90772f21 100644 --- a/singular.php +++ b/singular.php @@ -9,7 +9,23 @@ */ ?> - +