diff --git a/php/cloud/class-cloud-api.php b/php/cloud/class-cloud-api.php index 8d9bf1e6..f2e9c979 100644 --- a/php/cloud/class-cloud-api.php +++ b/php/cloud/class-cloud-api.php @@ -66,7 +66,7 @@ public function get_local_to_cloud_map() { // Fetch data from the stored transient, if available. $stored_data = get_transient( self::CLOUD_MAP_TRANSIENT_KEY ); - if ( $stored_data && is_array( $stored_data ) ) { + if ( $stored_data ) { $this->local_to_cloud_map = $stored_data; return $stored_data; } @@ -81,6 +81,12 @@ public function get_local_to_cloud_map() { continue; } + // If the snippet is a token snippet skip it. + $has_valid_cloud_id = boolval( strpos( $local_snippet->cloud_id, '_' ) ); + if ( ! $has_valid_cloud_id ) { + continue; + } + $link = new Cloud_Link(); $cloud_id = explode( '_', $local_snippet->cloud_id ); $cloud_id_int = (int) $cloud_id[0] ?? '';