Skip Navigation

[Resolved] Exposing REST API for post type does not populate the complete data set

This support ticket is created 5 years, 8 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 2 replies, has 2 voices.

Last updated by Luo Yang 5 years, 8 months ago.

Assisted by: Luo Yang.

Author
Posts
#1248517

When using the REST API and exposing the custom fields I do see the 'toolset-meta' added to the results but not all the fields are populated. For instance, for the first 5 custom posts the field in question is populated with data. All other posts with these fields are reporting back empty with I look at the API response. So it's only capturing some of the data. I checked in WordPress and indeed the data has been entered.

The field in question is a text field and I have about 120 posts. I have set to expose all fields using,

add_filter('toolset_rest_run_exposure_filters', '__return_true');

Thanks for your help.

#1248553

I made a discovery. The data will appear if I click the post button on each of the posts, even though the post is published. Possibly a bug with the plugin?

#1248873

Hello,

I assume we are talking about the "Publish" button when you edit a post.

If it is, what post status are those posts using before you publish? "draft" or "Pending"?
The wordpress REST API won't display non published post by default, you will need to make sure your REST API can be exposed in your REST API, for example:
https://developer.wordpress.org/rest-api/reference/posts/

A named status for the object.
Context: view, edit

One of: publish, future, draft, pending, private