From b7f181f0878e62f3c73645a7e3c5e8b3e94de982 Mon Sep 17 00:00:00 2001 From: Tetrakern <26898880+Tetrakern@users.noreply.github.com> Date: Thu, 31 Oct 2024 14:05:32 +0100 Subject: [PATCH] Improve guard clause for shortcode transient check --- includes/functions/_service-caching.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/includes/functions/_service-caching.php b/includes/functions/_service-caching.php index 656dfcbb..179293d9 100644 --- a/includes/functions/_service-caching.php +++ b/includes/functions/_service-caching.php @@ -125,8 +125,8 @@ if ( ! defined( 'FICTIONEER_ENABLE_STORY_CARD_CACHING' ) ) { * Whether to enable Transients for shortcodes * * @since 5.6.3 - * @since 5.23.1 - Do not turn off with cache plugin - * @since 5.25.0 - Refactored with option + * @since 5.23.1 - Do not turn off with cache plugin. + * @since 5.25.0 - Refactored with option. * * @param string $shortcode The shortcode in question. * @@ -134,7 +134,9 @@ if ( ! defined( 'FICTIONEER_ENABLE_STORY_CARD_CACHING' ) ) { */ function fictioneer_enable_shortcode_transients( $shortcode = null ) { - if ( is_customize_preview() || is_admin() ) { + global $pagenow; + + if ( is_customize_preview() || is_admin() || $pagenow === 'post.php' ) { return false; }