Skip Navigation

[Resolved] Creating my own custom field types

This thread is resolved. Here is a description of the problem and solution.

Problem:

I want to do is create a field that displays a select / pull-down menu of custom post types and allows a user to choose one.

Solution:

You can try the custom post reference field

Relevant Documentation:

https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/using-post-reference-fields-to-display-information-from-a-related-post/

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

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 josephC-5 5 years, 2 months ago.

Assisted by: Luo Yang.

Author
Posts
#1365107

Hi there,

I'd like to create my own custom field type using PHP. What I mean is that I want to create a field that isn't one of the standard fields (single line input, image, select menu, etc.). I'd like to create a *new* field.

Basically what I want to do is create a field that displays a select / pull-down menu of custom post types and allows a user to choose one. Should I perhaps consider using a metabox instead?

Saul

#1365229

Hello,

Q1) I'd like to create my own custom field type using PHP
There isn't such kind of feature within Types plugin, and according to our support policy, we don't provide custom codes support, you might check it with our Toolset Contractors:
https://toolset.com/contractors/

Q2) Basically what I want to do is create a field that displays a select / pull-down menu of custom post types and allows a user to choose one.

I assume you are going to connect one post with post of another post type, if it is, you can try the custom post reference field, see our document:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/using-post-reference-fields-to-display-information-from-a-related-post/
Using Post Reference Field To Display Data Of Related Posts

#1365731

Luo,

The Post Reference field is exactly the kind of thing I wanted to build from scratch. This saves me a ton of work.

Thank you!

Saul