Add new --meta_format to `wp post meta` commands
还没有人认领这个 Issue。
评估
调研方向
Review the post meta list and post meta get command behavior and their documented --format options first. Resolve the proposed name for the key-value JSON format, then make both commands emit the format expected by the post create and post update meta_input examples and verify the documented command outputs.
由索引模型根据 Issue 内容生成。
描述
According to the WP-CLI 1.5.0 Announcement:
The --meta_input option of the
post createandpost updatecommands now accepts JSON-formatted arrays, so you can add or update your post and its meta in one go:
$ wp post create --post_title='Title' --post_content='Content.' --meta_input='{"key1":"value1","key2":"value2"}
Success: Created post 123.
Unfortunately, there doesn't seem to be an equivalent export option for post meta list or post meta get.
wp post meta list 123 --fields=meta_key,meta_value --format=json will create [{"meta_key":"foo", "meta_value":"bar}] and not {"foo":"bar"} as shown in the examples for post update and post create.
[--format=<format>]
Accepted values: table, csv, json, count. Default: table
[--format=<format>]
Accepted values: table, json. Default: table
[--format=<format>]
Render output in a particular format.
---
default: table
options:
– table
– csv
– ids
– json
– count
– yaml
A suggestion has been made to add a new --format=meta_input or similar.
While the argument meta_input makes sense to solve this particular issue (based on import) it doesn't really describe the export type which is <key>:<value> JSON.
--format=meta_input--format=json-key-value--format=json-key:value--format=jsonkv--format=json-kv
- 主要语言
- PHP
- 星标
- 105
- 派生
- 97
- 平均合并
- 2 小时 1 分钟
- 30 天内合并 PR
- 12
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
wp-cli/entity-command 的其他 Issue
-
command:comment-delete state:unconfirmed
难度 3/5 1-2 天 新手友好度 35/100
wp-cli/entity-command#538 · 2 条评论 ·
-
command:option command:option-update
难度 5/5 一周以上 新手友好度 35/100
wp-cli/entity-command#230 · 11 条评论 · 1 个 reaction ·
查看 wp-cli/entity-command 的全部 Issue
相似的 Issue
-
sync-en
难度 1/5 1-3 小时 新手友好度 85/100
-
难度 1/5 1 小时以内 新手友好度 90/100
-
难度 2/5 1-3 小时 新手友好度 68/100
getgrav/grav-plugin-api#45 ·
-
难度 2/5 1-3 小时 新手友好度 78/100
RSS-Bridge/rss-bridge#5098 ·
-
难度 2/5 1-3 小时 新手友好度 68/100
phingofficial/phing#2025 ·