Add new --meta_format to `wp post meta` commands
まだ誰も着手していません。
評価
調査の方向性
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分
- マージ済み PR(30日)
- 12
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 1週間以上 初心者へのやさしさ 35/100
wp-cli/entity-command#230 · コメント 11 件 · リアクション 1 件 ·
wp-cli/entity-command の issue をすべて見る
似ている issue
-
a11y admissions.uiowa.edu needs grooming SiteImprove best practice
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
Save States Menu オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
pluginsGLPI/datainjection#673 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
octobercms/october#6130 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
getgrav/grav-plugin-form#656 ·