@@ -348,32 +348,39 @@ public function create( $_, $assoc_args ) {
348348
349349 $ value_map = [
350350 'dbname ' => [
351- 'type ' => 'constant ' ,
352- 'name ' => 'DB_NAME ' ,
351+ 'type ' => 'constant ' ,
352+ 'name ' => 'DB_NAME ' ,
353+ 'anchor ' => '/** Database username */ ' ,
353354 ],
354355 'dbuser ' => [
355- 'type ' => 'constant ' ,
356- 'name ' => 'DB_USER ' ,
356+ 'type ' => 'constant ' ,
357+ 'name ' => 'DB_USER ' ,
358+ 'anchor ' => '/** Database password */ ' ,
357359 ],
358360 'dbpass ' => [
359- 'type ' => 'constant ' ,
360- 'name ' => 'DB_PASSWORD ' ,
361+ 'type ' => 'constant ' ,
362+ 'name ' => 'DB_PASSWORD ' ,
363+ 'anchor ' => '/** Database hostname */ ' ,
361364 ],
362365 'dbhost ' => [
363- 'type ' => 'constant ' ,
364- 'name ' => 'DB_HOST ' ,
366+ 'type ' => 'constant ' ,
367+ 'name ' => 'DB_HOST ' ,
368+ 'anchor ' => '/** Database charset to use in creating database tables. */ ' ,
365369 ],
366370 'dbcharset ' => [
367- 'type ' => 'constant ' ,
368- 'name ' => 'DB_CHARSET ' ,
371+ 'type ' => 'constant ' ,
372+ 'name ' => 'DB_CHARSET ' ,
373+ 'anchor ' => '/** The database collate type. Don \'t change this if in doubt. */ ' ,
369374 ],
370375 'dbcollate ' => [
371- 'type ' => 'constant ' ,
372- 'name ' => 'DB_COLLATE ' ,
376+ 'type ' => 'constant ' ,
377+ 'name ' => 'DB_COLLATE ' ,
378+ 'anchor ' => '/**#@+ ' ,
373379 ],
374380 'dbprefix ' => [
375- 'type ' => 'variable ' ,
376- 'name ' => 'table_prefix ' ,
381+ 'type ' => 'variable ' ,
382+ 'name ' => 'table_prefix ' ,
383+ 'anchor ' => '/* Add any custom values between this line and the "stop editing" line. */ ' ,
377384 ],
378385 ];
379386
@@ -388,6 +395,19 @@ public function create( $_, $assoc_args ) {
388395 $ assoc_args [ $ arg_name ],
389396 [ 'add ' => true ]
390397 );
398+
399+ if ( false !== strpos ( $ assoc_args [ $ arg_name ], '\\' ) ) {
400+ $ config_transformer ->remove ( $ entry ['type ' ], $ entry ['name ' ] );
401+ $ config_transformer ->add (
402+ $ entry ['type ' ],
403+ $ entry ['name ' ],
404+ $ assoc_args [ $ arg_name ],
405+ [
406+ 'anchor ' => $ entry ['anchor ' ],
407+ 'placement ' => 'before ' ,
408+ ]
409+ );
410+ }
391411 }
392412
393413 if ( ! empty ( $ assoc_args ['keys-and-salts ' ] ) ) {
0 commit comments