-
Notifications
You must be signed in to change notification settings - Fork 654
-
Notifications
You must be signed in to change notification settings - Fork 654
POST_META not showing up #245
Comments
In 1.0, custom meta changed to only being exposed on the edit context, as exposing it by default is a possible privacy issue. You'll also need to be authenticated to use this. You can set the context to |
Do you plan to allow meta to be managed on post creation and edit, or is this a case for using a custom handler? |
Should already be possible, using the same format as the standalone meta endpoints. :) |
Thank you! I was apparently doing_it_wrong. |
@schmitzoide I am sorry for being slow to add more details to our post routes documentation surrounding how to view/edit post_meta fields. We you able to get this figured out? We are using #213 to track adding the full post_meta details to our docs. |
@rachelbaker What I did (still in early development stage) was commented out the part where it checks for permition ($this->check_edit_permission( $post )). I tried with Basic Authentication and context=edit as a parameter but it didn't work, still stating I cannot edit. |
@schmitzoide For security and data integrity reasons there are several conditions that must be met for a post_meta key to be edited. We check that you can edit the post, that the meta field isn't protected, the meta value isn't an array, object or serialized. https://github.com/WP-API/WP-API/blob/master/lib/class-wp-json-posts.php#L1011 Does that help? |
Closing, not sure there are any issues left here to actually handle. |
I've just updated to the last version and lost access to post_meta information (where I did access the custom fields for that post type) on the /posts&type=custom_type route. Even stranger, it sometimes appears, sometimes it doesn't. Any guess on what's going on?
The text was updated successfully, but these errors were encountered: