admin管理员组

文章数量:1122832

you need to add a constant when building a docker file wp-config.php

define( 'AS3CF_SETTINGS', serialize( array(
'provider' => 'aws',
'access-key-id' => '*****',
'secret-access-key' => '****',

tried using command - wp config set AS3CF_SETTINGS [' "asd" => "asd", "dsa" => "dsa"'], it passes the string(

please tell me is it possible to transfer this as an array?

you need to add a constant when building a docker file wp-config.php

define( 'AS3CF_SETTINGS', serialize( array(
'provider' => 'aws',
'access-key-id' => '*****',
'secret-access-key' => '****',

tried using command - wp config set AS3CF_SETTINGS [' "asd" => "asd", "dsa" => "dsa"'], it passes the string(

please tell me is it possible to transfer this as an array?

Share Improve this question asked Sep 28, 2020 at 8:29 pechapecha 111 bronze badge 3
  • 1 Does this answer your question? How to update an 'array' option using wp-cli – leymannx Commented Sep 28, 2020 at 9:21
  • With --format=json for example: wordpress.stackexchange.com/a/345118/30597 – leymannx Commented Sep 28, 2020 at 9:22
  • --format=json is available for setting options, not in the config command. – squarecandy Commented Aug 28, 2024 at 14:45
Add a comment  | 

1 Answer 1

Reset to default 0

The only good way I could find to do this was with the --raw option.

wp config set 'AS3CF_SETTINGS' "array( 'sample' => 'bar', 'c' => '***' )" --raw
wp config set 'AS3CF_SETTINGS' "serialize( array( 'foo' => 'bar', 'c' => '***' ) )" --raw
# etc...

本文标签: wp cliHow to add an array to a command quotwp config setquot