`wp theme mod set` prints its failure message as `Success` and exits 0
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Read Theme_Mod_Command::set() where the issue says the mismatched value is detected and the failure message is printed. Check how neighboring command failures report errors and set exit status; reproduce with the described pre_set_theme_mod_background_color filter. Done means the command prints Error: Could not update theme mod background_color. and exits with code 1.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- Gherkin
- Stars
- 90
- Forks
- 87
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wp-cli/extension-command
-
Download update packages concurrently before running the bulk upgraderPossibly taken @austinginder claimed this 49 days ago. Opencommand:plugin-update command:theme-update
Difficulty 4/5 3-5 days Newbie friendliness 48/100
wp-cli/extension-command#555 · 2 comments ·
-
opcache invalidationPossibly taken @swissspidy claimed this 265 days ago. Opencommand:plugin-update command:theme-update
wp-cli/extension-command#444 · 10 comments · 1 reaction · 2 assignees ·
-
Add wp theme cache commandPossibly taken @swissspidy claimed this 277 days ago. Opencommand:theme state:unconfirmed
wp-cli/extension-command#392 · 9 comments · 1 reaction · 2 assignees ·
All issues in wp-cli/extension-command
Similar issues
-
csp-probe needs efqdn to probe CSP domainsPossibly taken @unknownhackerworld claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
projectdiscovery/httpx#2725 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ktwu01/benchmark-radar#1167 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
domain/usage p3
Difficulty 2/5 1-3 hours Newbie friendliness 72/100