Skip to content

Typo in wp post update example #140

@jgraup

Description

@jgraup

One example in the docs for wp post update is missing a closing ' at https://developer.wordpress.org/cli/commands/post/update/#examples & https://developer.wordpress.org/cli/commands/post/create/#examples

This example:

$ wp post update 123 --meta_input='{"key1":"value1","key2":"value2"}

Should be:

$ wp post update 123 --meta_input='{"key1":"value1","key2":"value2"}'

I noticed when trying to import from a file that any space in the meta values will break this command without enclosing the JSON in single quotes.

--meta_input='$( cat filename.json )' 

Quick question about the reverse of this. Does wp post meta list include a way to structure the export data for this import? It seems like even if you reduce the output fields to key & value that the JSON structure is different. 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 listed above.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions