Hide invisible posts in public caches
This commit is contained in:
parent
39a9f5ce10
commit
5deeb29991
@ -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`
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<div class="progress">
|
||||
|
@ -15,7 +15,23 @@
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
<?php
|
||||
|
||||
// Header
|
||||
get_header( null, array( 'type' => '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();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<main id="main" class="main collection">
|
||||
<div class="observer main-observer"></div>
|
||||
|
@ -11,7 +11,23 @@
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header( null, array( 'type' => 'fcn_recommendation' ) ); ?>
|
||||
<?php
|
||||
|
||||
// Header
|
||||
get_header( null, array( 'type' => '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();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<main id="main" class="main recommendation">
|
||||
<div class="observer main-observer"></div>
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<main id="main" class="main story">
|
||||
|
@ -8,7 +8,23 @@
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
<?php
|
||||
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<main id="main" class="main post">
|
||||
<div class="observer main-observer"></div>
|
||||
|
@ -9,7 +9,23 @@
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
<?php
|
||||
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<main id="main" class="main singular">
|
||||
<div class="observer main-observer"></div>
|
||||
|
18
singular.php
18
singular.php
@ -9,7 +9,23 @@
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php get_header(); ?>
|
||||
<?php
|
||||
|
||||
// Header
|
||||
get_header();
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<main id="main" class="main singular">
|
||||
<div class="observer main-observer"></div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user