From e0f33294493dc4a162c1990696fb702a7a4d6a36 Mon Sep 17 00:00:00 2001 From: Ramon Date: Tue, 21 Dec 2021 18:10:59 -0300 Subject: [PATCH] Refactor render_block_callback --- includes/blocks/site-automation-block/register.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/blocks/site-automation-block/register.php b/includes/blocks/site-automation-block/register.php index 223f2173..4efd8dbf 100644 --- a/includes/blocks/site-automation-block/register.php +++ b/includes/blocks/site-automation-block/register.php @@ -42,7 +42,9 @@ function render_block_callback( $attributes, $content, $block ) { $curated_posts_transient_key = 'sophi_curated_posts_' . $page_name . '_' . $widget_name; - if ( false === ( $curated_posts = get_transient( $curated_posts_transient_key ) ) ) { + $curated_posts = get_transient( $curated_posts_transient_key ); + + if ( false === $curated_posts ) { // phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.get_posts_get_posts $curated_posts = get_posts( [