You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ 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.
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.
Activity
schlessera commentedon Feb 9, 2018
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_inputor similar.