WordPress Custom Rest Api – How to get Image Url?
$post->ad_1[0][‘top_image’] will not return you data, because you are not in JS which got response from your REST api which had injected ad_1 value into object which it returns to you. In your PHP code $post is of type WP_Post and it doesn’t have ad_1 in it, that’s why you getting nulls. I don’t know … Read more