`wp theme mod set` prints its failure message as `Success` and exits 0
评估
调研方向
阅读 Theme_Mod_Command::set(),issue指出这里会检测到不匹配的值并打印失败消息。检查相邻命令失败时如何报告错误并设置退出状态;使用描述的过滤器 pre_set_theme_mod_background_color 重现问题。完成标准是命令打印 Error: Could not update theme mod background_color. 并以代码 1 退出。
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Gherkin
- 星标
- 90
- 派生
- 87
- 平均合并
- 2 天 7 小时
- 30 天内合并 PR
- 3
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
wp-cli/extension-command 的其他 Issue
-
Download update packages concurrently before running the bulk upgrader可能已有人在做 @austinginder 于 49 天前认领。 未关闭command:plugin-update command:theme-update
难度 4/5 3-5 天 新手友好度 48/100
wp-cli/extension-command#555 · 2 条评论 ·
-
opcache invalidation可能已有人在做 @swissspidy 于 265 天前认领。 未关闭command:plugin-update command:theme-update
wp-cli/extension-command#444 · 10 条评论 · 1 个 reaction · 已指派 2 人 ·
-
Add wp theme cache command可能已有人在做 @swissspidy 于 277 天前认领。 未关闭command:theme state:unconfirmed
wp-cli/extension-command#392 · 9 条评论 · 1 个 reaction · 已指派 2 人 ·
查看 wp-cli/extension-command 的全部 Issue
相似的 Issue
-
csp-probe needs efqdn to probe CSP domains可能已有人在做 @unknownhackerworld 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 72/100
projectdiscovery/httpx#2725 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 2/5 1-3 小时 新手友好度 84/100
-
难度 2/5 1-3 小时 新手友好度 82/100
ktwu01/benchmark-radar#1167 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 2 天内回复
-
domain/usage p3
难度 2/5 1-3 小时 新手友好度 72/100