Skip to content

Commit a3d8447

Browse files
committed
Enhance default connection ID retrieval with validation check
1 parent 8256100 commit a3d8447

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

disciple-tools-storage-filters.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ public static function update_default_connection_id( string $connection_id ): bo
2020
public static function get_default_connection_id(): string {
2121
$storage_connection_id = dt_get_option( 'dt_storage_connection_id' );
2222

23+
// Return if a valid storage connection id is found.
24+
if ( !empty( $storage_connection_id ) ) {
25+
return $storage_connection_id;
26+
}
27+
2328
// Default to multisite global setting, if available; otherwise revert to local settings.
2429
if ( is_multisite() && !empty( get_site_option( 'dt_storage_multisite_connection_object', [] ) ) ) {
2530
$multisite_connection_objects = get_site_option( 'dt_storage_multisite_connection_object', [] );

0 commit comments

Comments
 (0)