Skip to content

Commit 47304a6

Browse files
swissspidyCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 59c62ae commit 47304a6

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/Config_Command.php‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,13 +391,14 @@ public function create( $_, $assoc_args ) {
391391
}
392392

393393
if ( is_string( $provided_assoc_args[ $arg_name ] ) && false !== strpos( $provided_assoc_args[ $arg_name ], '\\' ) ) {
394-
// Use remove+add to preserve backslash escaping when writing with WPConfigTransformer.
394+
// Use remove+update to preserve backslash escaping while keeping insertion behavior aligned with the rest of this class.
395395
$config_transformer->remove( $entry['type'], $entry['name'] );
396-
$config_transformer->add(
396+
$config_transformer->update(
397397
$entry['type'],
398398
$entry['name'],
399399
$provided_assoc_args[ $arg_name ],
400400
[
401+
'add' => true,
401402
'anchor' => $entry['anchor'],
402403
'placement' => 'before',
403404
]

0 commit comments

Comments
 (0)