Saltar navegación

[Resuelto] 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 -

Zona horaria del colaborador: Asia/Kolkata (GMT+05:30)

Este tema contiene 1 respuesta, tiene 1 mensaje.

Última actualización por Saul Baizman 1 year, 4 months ago.

Asistido por: Minesh.

Autor
Mensajes
#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
Colaborador

Idiomas: Inglés (English )

Zona horaria: 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