<?php

function pgp_custom_rest(){

    register_rest_field(array('news','markets','tutorials','venders','forum','top_forums','other_services','tlg_channels'), '_pgp', array(
            'get_callback' => function (){
	            global $post;
	            $pgp_key = get_post_meta($post->ID, '_pgp',true);
                wp_reset_postdata();
                return $pgp_key;
            }
    ));
}
add_action('rest_api_init', 'pgp_custom_rest' );
