Skip to content

Typo in wp post update example #140

Closed

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.

Activity

  1. schlessera commented on Feb 9, 2018

    @schlessera
    Member

    Does wp post meta list include a way to structure the export data for this import?

    That's a great idea. Would you mind creating a separate issue so that we can discuss how to about this? I'm think of an additional --format=meta_input or similar.

  2. added this to the 1.3.0 milestone on Feb 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions