{"action":"created","issue":{"url":"https://api.github.com/repos/zachfeldman/rubypress/issues/42","labels_url":"https://api.github.com/repos/zachfeldman/rubypress/issues/42/labels{/name}","comments_url":"https://api.github.com/repos/zachfeldman/rubypress/issues/42/comments","events_url":"https://api.github.com/repos/zachfeldman/rubypress/issues/42/events","html_url":"https://github.com/zachfeldman/rubypress/issues/42","id":77680302,"number":42,"title":"Add new post with metadata","user":{"login":"i42n","id":144173,"avatar_url":"https://avatars.githubusercontent.com/u/144173?v=3","gravatar_id":"","url":"https://api.github.com/users/i42n","html_url":"https://github.com/i42n","followers_url":"https://api.github.com/users/i42n/followers","following_url":"https://api.github.com/users/i42n/following{/other_user}","gists_url":"https://api.github.com/users/i42n/gists{/gist_id}","starred_url":"https://api.github.com/users/i42n/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/i42n/subscriptions","organizations_url":"https://api.github.com/users/i42n/orgs","repos_url":"https://api.github.com/users/i42n/repos","events_url":"https://api.github.com/users/i42n/events{/privacy}","received_events_url":"https://api.github.com/users/i42n/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-18T14:37:37Z","updated_at":"2015-05-18T14:43:50Z","closed_at":null,"body":"I currently try to create new wordpress posts with metadata as described here: https://developer.wordpress.com/docs/api/1.1/post/sites/%24site/posts/new/\r\n\r\n> Array of metadata objects containing the following properties: `key` (metadata key), `id` (meta ID), `previous_value` (if set, the action will only occur for the provided previous value), `value` (the new value to set the meta to), `operation` (the operation to perform: `update` or `add`; defaults to `update`). All unprotected meta keys are available by default for read requests. Both unprotected and protected meta keys are avaiable for authenticated requests with proper capabilities. Protected meta keys can be made available with the rest_api_allowed_public_metadata filter.\r\n\r\nIt uses the wordpress custom fields: https://codex.wordpress.org/Custom_Fields\r\n\r\nHowever I do not know how to do that with rubypress.\r\n\r\n```ruby\r\n\twp.newPost( :blog_id => \"0\", # 0 unless using WP Multi-Site, then use the blog id\r\n\t            :content => {\r\n\t                         :post_status  => \"draft\",\r\n\t                         :post_date    => entry.published,\r\n\t                         :post_content => entry.content,\r\n\t                         :post_title   => entry.title,\r\n\t                         :post_name    => post_name,\r\n\t                         :post_type    => \"podcast\",\r\n\t                         :post_author  => 1\r\n\t                         :metadata     => [] # what do I have to write here?\r\n\t                         }\r\n\t            )\r\n```\r\n\r\nCan you tell me how to do that? Is that even possible with rubypress? I do not understand how wordpress wants the \"objects\" to be encoded.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/zachfeldman/rubypress/issues/comments/103083145","html_url":"https://github.com/zachfeldman/rubypress/issues/42#issuecomment-103083145","issue_url":"https://api.github.com/repos/zachfeldman/rubypress/issues/42","id":103083145,"user":{"login":"zachfeldman","id":1437644,"avatar_url":"https://avatars.githubusercontent.com/u/1437644?v=3","gravatar_id":"","url":"https://api.github.com/users/zachfeldman","html_url":"https://github.com/zachfeldman","followers_url":"https://api.github.com/users/zachfeldman/followers","following_url":"https://api.github.com/users/zachfeldman/following{/other_user}","gists_url":"https://api.github.com/users/zachfeldman/gists{/gist_id}","starred_url":"https://api.github.com/users/zachfeldman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zachfeldman/subscriptions","organizations_url":"https://api.github.com/users/zachfeldman/orgs","repos_url":"https://api.github.com/users/zachfeldman/repos","events_url":"https://api.github.com/users/zachfeldman/events{/privacy}","received_events_url":"https://api.github.com/users/zachfeldman/received_events","type":"User","site_admin":false},"created_at":"2015-05-18T14:43:50Z","updated_at":"2015-05-18T14:43:50Z","body":"Hey there, why don't you just try it? Sounds like you need to pass in an array of hashes. Rubypress deep merges any passed in objects."}}