Options to get my custom post type metadata via the WordPress API
I am using a plugin that adds multiple custom post types all of which have their own meta-data. I am able to expose the custom post type to WordPress’s API but the metadata collected with those post is not.
For example “Team Members” is a post type and it is declared in the
team.php file. I was able to add it to the WP API via
'show_in_rest' => true, there is also a
team-metaboxes.php which I tried to add the same attribute to by am not seeing it in the API JSON.
I am seeing the team metadata in the
wp_postmeta table in the DB but I am having a hard time accessing it via the API.
What are my options. As of now I am using:
But am not sure how to get the metadata for the team-post content types.
Leave an answer