'product', 'post_status' => 'any', 'posts_per_page' => 1, 'fields' => 'ids', 'meta_query' => array( // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query -- transient caches the result. array( 'key' => '_subscrpt_enabled', 'compare' => 'EXISTS', ), ), ) ); // Store as a non-empty array or an empty string ([] can't be distinguished from false). set_transient( $transient_key, $has_subscrpt_product ? $has_subscrpt_product : 'none', DAY_IN_SECONDS ); } if ( 'none' !== $has_subscrpt_product && ! empty( $has_subscrpt_product ) ) { return; } ?>

01

02

03