Skip to content

Commit 2736a09

Browse files
gzioloclaude
andcommitted
Connectors: Align setting name auto-generation with Gutenberg.
Use string interpolation with str_replace wrapping the full string, matching the Gutenberg implementation. See #64957. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8d88875 commit 2736a09

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/class-wp-connector-registry.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public function register( string $id, array $args ): ?array {
214214
}
215215
$connector['authentication']['setting_name'] = $args['authentication']['setting_name'];
216216
} else {
217-
$connector['authentication']['setting_name'] = 'connectors_' . str_replace( '-', '_', $args['type'] . '_' . $id ) . '_api_key';
217+
$connector['authentication']['setting_name'] = str_replace( '-', '_', "connectors_{$connector['type']}_{$id}_api_key" );
218218
}
219219
if ( isset( $args['authentication']['constant_name'] ) ) {
220220
if ( ! is_string( $args['authentication']['constant_name'] ) || '' === $args['authentication']['constant_name'] ) {

0 commit comments

Comments
 (0)