if ( rest_is_field_included( 'title.rendered',
$fields ) ) { add_filter( 'protected_title_format', array
( $this, 'protected_title_format'
) );
$data['title'
]['rendered'
] =
get_the_title( $post->ID
);
remove_filter( 'protected_title_format', array
( $this, 'protected_title_format'
) );
} $has_password_filter = false;
if ( $this->
can_access_password_content( $post,
$request ) ) { $this->password_check_passed
[ $post->ID
] = true;
// Allow access to the post, permissions already checked before.
add_filter( 'post_password_required', array
( $this, 'check_password_required'
), 10, 2
);
$has_password_filter = true;
} if ( rest_is_field_included( 'content',
$fields ) ) { $data['content'
] = array
();
} if ( rest_is_field_included( 'content.raw',
$fields ) ) {