Hi,
I've joined TYPES again. I would like to build a headless CMS with the REST API. I would also have to get the custom fields given out for my own endpoints.
when I call an existing endpoint: hidden link the toolset meta data is in there.
but when I call my own endpoint:
hidden link
there are no custom fields, why.
my endpoint filter looks like this in functions.php:
add_filter("wcra_pagerecursive_callback" , "wcra_pagerecursive_callback_handler");
function wcra_pagerecursive_callback_handler($param){
$parent_id = $param['parentId'];
$args = array(
'post_type' => 'page',
'posts_per_page' => -1,
'post_parent' => $parent_id,
'order' => 'ASC',
'orderby' => 'menu_order'
);
$myquery = new WP_Query( $args );
$mypages = $myquery->posts;
return $mypages;
}
Hi there,
This is customization and is outside of our support scope. We will not be able to give the exact code but we can help you to get started.
I suggest that you read the ticket below to know where to start and how you can expose the Toolset fields to your custom REST API endpoint:
https://toolset.com/forums/topic/read-out-custom-post-types-php-query-rest-api-toolset/
Thank you.