I'm getting this in my json response
"Gallery Images": [
"1833",
"1834",
"1835"
],
Those are the ID's of my custom post gallery , I need to get the URL of each ID. I did't find any solution, all images com from custom filed. My field it's called "_job_gallery_images"
Any help will be very appreciated.
Seems like I wasn't even modifying my json response because of a plugin I had activated, turning it off made me declare my meta in my functions.php file and no I have this.
` add_action('rest_api_init', 'register_custom_fields', 1, 1);
function register_custom_fields(){
register_rest_field(
'job_listing',
'gallery',
array(
'get_callback' => 'show_image'
)
);
}
function show_main_image($object, $field_name, $request){
$custom_fields = get_post_custom($object['id']);
$main_image = $custom_fields['_job_gallery_images'];
return $main_image;
}`
But still no luck, now the "_job_gallery_images" endpoint appears to be empty i need to response all url instead of ID