When I use enable_maintenance_mode”:”false” it seems that the objet containing seedprod settings just dissapears, tha’ts why it gives an error trying to put maintenance_mode true.
Hi, you need to pass the entire object, also notice true and false don’t have quotes.
{
"api_key":"",
"enable_coming_soon_mode":false,
"enable_maintenance_mode":false,
"enable_login_mode":false,
"enable_404_mode":false
}
Hello and thanks for the reply.
Do you mean that i need to pass all the object even if I’m looking just to update one value? How do you pass an entire object wit wp-cli?
I was trying using
wp –url=subsite.multisite.com –allow-root option update seedprod_settings ‘{“api_key”:””,”enable_coming_soon_mode”:false,”enable_maintenance_mode”:true,”enable_login_mode”:false,”enable_404_mode”:false}’ –format=json
PHP Warning: json_decode() expects parameter 1 to be string, array given in /home/multisite.com/public_html/wp-content/plugins/coming-soon/app/render-csp-mm.php on line 36
Success: Updated ‘seedprod_settings’ option.
[root@multisite public_html]#”
But same error, nothing is updated.
-
This reply was modified 4 years, 3 months ago by
diegosev.
It seems to be happening only when i use “enable_maintenance_mode”:true” , if i use the command to deactivate maintenance mode it works perfect.
This works fine:
wp –url=milanesasboludas.pidepaya.com –allow-root option update seedprod_settings ‘{“api_key”:””,”enable_coming_soon_mode”:false,”enable_maintenance_mode”:false,”enable_login_mode”:false,”enable_404_mode”:false}’ –format=json
This doesn’t work:
wp –url=subsite.multisite.com –allow-root option update seedprod_settings ‘{“api_key”:””,”enable_coming_soon_mode”:false,”enable_maintenance_mode”:true,”enable_login_mode”:false,”enable_404_mode”:false}’ –format=json
Now i don’t have any visible errors but it is not working. System indicates success but the options of the seedprod_settings are gone from the subsite settings if y try to turn true maintenance_mode using wp-cli.
-
This reply was modified 4 years, 3 months ago by
diegosev.
-
This reply was modified 4 years, 3 months ago by
diegosev.
I’m running this locally and it works fine:
wp option update seedprod_settings '{"api_key":"","enable_coming_soon_mode":true,"enable_maintenance_mode":false,"enable_login_mode":true,"enable_404_mode":false}'
Note this is a string, I don’t need to include a format
You are right 😀 , no need to put the format option and everything works! thanks for the quick replys sr.