You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
wp theme mod set prints its failure message as Success and exits 0 #570
When wp theme mod set cannot save the value, it prints the failure through WP_CLI::success():
$ wp theme mod set background_color 123456
Success: Could not update theme mod background_color.
$ echo $?
0
To reproduce, add a pre_set_theme_mod_background_color filter that returns a different value (for example from a mu-plugin). Theme_Mod_Command::set() reads the mod back, sees it does not match, and calls WP_CLI::success( "Could not update theme mod {$mod}." ). Scripts that check the exit code treat the failure as a success.
Expected: Error: Could not update theme mod background_color. with exit code 1.
Activity