I’ll try and keep this as short, sweet, and concise as I can. So I’m letting users create JSON files for an API by filling out a Flexible Field. I need to build and save these JSON files anytime they updated the post so I don’t reach the limit of the number of times we can hit the API.
Anyway, I need to use get_post_meta to pass the fields so I can build the JSON file. So here is what I have and these 3 work.
$bc_id = get_post_meta( $post_id, 'page_biblio_2', true );
$bc_uri = get_post_meta( $bc_id[0], 'request_uri', true );
$bc_type = get_post_meta( $bc_id[0], 'type_of_request', true );
But the next 4 are wrapped in a Flexible Field and do not work. What am I doing wrong?
$bc_media = get_post_meta( $bc_id[0], 'media_type', true );
$bc_audience = get_post_meta( $bc_id[0], 'audience', true );
$bc_content = get_post_meta( $bc_id[0], 'content_class', true );
$bc_custom = get_post_meta( $bc_id[0], 'custom_query', true );