Skip to content

Commit

Permalink
Remove the unused caching logic
Browse files Browse the repository at this point in the history
  • Loading branch information
manzoorwanijk committed Dec 20, 2024
1 parent f6b41d7 commit a71f39c
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions projects/packages/publicize/src/class-connections.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 );
}
}

0 comments on commit a71f39c

Please sign in to comment.