-
Notifications
You must be signed in to change notification settings - Fork 93
Implement --meta_input with post create & post update
#133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
--meta_input with post create & post update
The `meta_input` argument to `wp_insert_post()` was introduced with WordPress 4.4.0.
| * Success: Created post 1922. | ||
| * | ||
| * # Create a post with multiple meta values. | ||
| * $ wp post create --post_title='A post' --post_content='Just a small post.' --meta_input='{"key1":"value1","key2":"value2"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ' is not balanced here.
--meta_input='{"key1":"value1","key2":"value2"}'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been fixed a while ago in #147.
| * Success: Updated post 123. | ||
| * | ||
| * # Update a post with multiple meta values. | ||
| * $ wp post update 123 --meta_input='{"key1":"value1","key2":"value2"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ' is not balanced here.
it should be :
--meta_input='{"key1":"value1","key2":"value2"}'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, thanks!
This needs wp-cli/wp-cli#4623 to land first.
See wp-cli/wp-cli#4616