Skip to content

Commit 8ddf24f

Browse files
gzioloclaude
andcommitted
Connectors: Add method_exists() check for getLogoPath().
The getLogoPath() method may not be available in all versions of the PHP AI client. This guards against a fatal error when the method is missing. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 08ef366 commit 8ddf24f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/connectors.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ function _wp_connectors_init(): void {
183183

184184
$name = $provider_metadata->getName();
185185
$description = $provider_metadata->getDescription();
186-
$logo_url = $provider_metadata->getLogoPath()
186+
$logo_url = method_exists( $provider_metadata, 'getLogoPath' ) && $provider_metadata->getLogoPath()
187187
? _wp_connectors_resolve_ai_provider_logo_url( $provider_metadata->getLogoPath() )
188188
: null;
189189

0 commit comments

Comments
 (0)