From a71f39c56fbbe54b61bb74b16fd13922abde7394 Mon Sep 17 00:00:00 2001 From: Manzoor Wani Date: Fri, 20 Dec 2024 09:45:44 +0530 Subject: [PATCH] Remove the unused caching logic --- .../publicize/src/class-connections.php | 22 +------------------ 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/projects/packages/publicize/src/class-connections.php b/projects/packages/publicize/src/class-connections.php index 8a4abe4a9e578..de30d41e264ae 100644 --- a/projects/packages/publicize/src/class-connections.php +++ b/projects/packages/publicize/src/class-connections.php @@ -33,22 +33,9 @@ public static function get_all( $args = array() ) { $is_wpcom = ( new Host() )->is_wpcom_simple(); if ( $is_wpcom ) { - // We don't need to cache connections for simple sites. $connections = Connections_Controller::get_connections( $run_tests ); } else { - - $clear_cache = $args['clear_cache'] ?? false; - - if ( $clear_cache || $run_tests ) { - self::clear_transient(); - } - - $connections = get_transient( self::CONNECTIONS_TRANSIENT ); - - // This can be an empty array, so we need to check for false. - if ( false === $connections ) { - $connections = self::fetch_and_cache_connections( $run_tests ); - } + $connections = self::fetch_and_cache_connections( $run_tests ); } // Let us add the deprecated fields for now. @@ -104,11 +91,4 @@ public static function fetch_and_cache_connections( $run_tests = false ) { return $connections; } - - /** - * Delete the transient. - */ - public static function clear_transient() { - delete_transient( self::CONNECTIONS_TRANSIENT ); - } }