Skip Navigation

[Gelöst] enabling custom fields to be accessible via the REST API?

This support ticket is created vor 7 Jahre, 11 Monate. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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

Supporter timezone: Africa/Cairo (GMT+02:00)

This topic contains 4 Antworten, has 2 Stimmen.

Last updated by joshB-6 vor 7 Jahre, 11 Monate.

Assisted by: Ahmed Hussein.

Author
Artikel
#399001

I am trying to: enable custom fields to be accessible via the REST API?

#399086

Hi, Thanks for contacting Toolset support forums.

How are you planning to get REST API support for WP, using a plugin or doing it manually?

Cheers!

#399090

Hi Ahmed.

Thank you for your reply.

We are using the wp-api plugin. hidden link

We have successfully been able to authenticate oauth and enabled the custom post to be accessible by the rest, and can go a GET on them without a problem, However the custom fields associated with the CPT are not accessible through the API.

The standard wordpress posts work fine. everything about the API works fine except for the above.

#399144

Unfortunately, such a feature isn't a part of our plugin but after taking a look on REST API v2 plugin I found that you can modify the response and add any additional data that you may need.

WP-types stores the the values as postmeta, so you should add the the wpcf- prefix when you query for it. You can read more about querying postmeta in rest API here: hidden link

Also, if you need help with the custom coding, you may contact one of our certified partners, and they'll be more than happy to help you. https://toolset.com/consultant/

I hope that answers you question.

Cheers!

#400148

Thanks for the reply. I was hoping to be able to use REST but will use an alternate solution.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.