Skip Navigation

[Resolved] Types Rest API Endpoint integration

This support ticket is created 2 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Christopher Amirian 2 years, 2 months ago.

Assisted by: Christopher Amirian.

Author
Posts
#2476199

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;
}

#2476967

Christopher Amirian
Supporter

Languages: English (English )

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.