Add new --meta_format to `wp post meta` commands
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- PHP
- Estrellas
- 105
- Forks
- 97
- Merge medio
- 2 h 1 min
- PR fusionados (30 d)
- 12
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de wp-cli/entity-command
-
command:comment-delete state:unconfirmed
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
wp-cli/entity-command#538 · 2 comentarios ·
-
command:option command:option-update
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
wp-cli/entity-command#230 · 11 comentarios · 1 reacción ·
Todos los issues de wp-cli/entity-command
Issues similares
-
[Chore] Keep one viget-block-generator skill and replicate it, instead of four tracked copies Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
hector-jewell/food-delivery-system-for-restaurant-using-php#1311 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Sylius/SyliusGridBundle#501 ·