Skip Navigation

[Resolved] Retrieving custom post types created in Toolset via PHP

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 1 reply, has 1 voice.

Last updated by Saul Baizman 2 weeks, 2 days ago.

Assisted by: Minesh.

Author
Posts
#2795101

Hi there,

I'm trying write custom PHP code to retrieve a list of custom post types that have been created in Toolset. I tried using the WordPress function get_post_types(), but its output does not include post types defined in the Toolset interface. I searched the Toolset documentation for API information (at https://toolset.com/documentation/programmer-reference/) and couldn't find anything.

Can you offer any guidance? For example, are the post type definitions hiding in wp_postmeta somewhere?

Thank you.

Saul

#2795110

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

There is no straight list of post type but you can try to access the option key "wpcf-custom-types" from the "wp_options" table that holds the serialize array that stores all the information related to post types using the WordPress function: get_option()

For example:

$all_info = get_option("wpcf-custom-types");

More info:
- https://developer.wordpress.org/reference/functions/get_option/

#2795177

Minesh,

This is precisely what I was seeking.

Thank you so much for your help!

Saul