Skip to content
This repository has been archived by the owner on Sep 24, 2018. It is now read-only.

Actually check if the meta is protected, not just disable all post_meta ... #10

Merged
merged 1 commit into from Nov 1, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/class-wp-json-posts.php
Expand Up @@ -612,7 +612,7 @@ protected function prepare_meta( $post_id ) {

foreach ( (array) has_meta( $post_id ) as $meta ) {
// Don't expose protected fields.
if ( ! current_user_can( 'edit_post_meta', $post_id, $meta['meta_key'] ) )
if ( is_protected_meta( $meta['meta_key'] ) )
continue;

$custom_fields[] = array(
Expand Down