Skip Navigation

[Resolved] What fields are required for a custom post type?

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

Problem: I would like to know which of the standard fields are required for a custom post type?

Solution: None of the fields are required. You can adjust the fields displayed by going to Toolset > Post Types and editing the custom post type.

This support ticket is created 4 years, 7 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#1313547

Hello... I am trying to create a database of contractors and would like them to be able to register their information into a custom post type so I can easily display them in an archive and search them by a particular specialty or skill. So, I created a Taxonomy for "skills" (allowing additional skills to be added at the time a new Contractor was being added) and created a "Contractor" Post Type. Finally, I created a Custom Fields Group, named "Contractors" and connected everything. I intended to create a form to allow public access to register as a new contractor, but went in to try and add a new contractor using the WordPress Administration area, I noticed it wanted me to provide a title - a field I had not included in my Custom Fields Group. So the following questions occur to me...

(1) Are there required fields for a custom post type? If not, am I prepending the title field accidentally with a setting somewhere or what?

(2) Which form (post or user) would you suggest to use on the front end to allow the public to register as a new contractor to be added? I ask because contractors can be either an entity (a company) or an individual. And, at least in theory, a contractor could have more than one contact, so I was thinking the Contractor post type would be created with a post form and I could restrict that creation to on those who were already registered as a WordPress user. But when I was thinking about trying to possibly connect multiple users to a single contractor it got a bit fuzzy.

I would appreciate your assistance on any or all of these considerations.

Thanks in advance.

#1313567

P.S.

(3) What's the difference in the fields that are added at the time I create a form and the fields that I manually add to a Custom Fields Group? There seems to be this duel set of fields whether I am creating a post form or a user form.

Thanks

#1313745
Image 2019-08-10 at 12.55.00 PM.png

More specifically, the documentation says:

"Based on the post type you will see that some fields are already added to your form. You can delete and reorder fields. Mandatory form fields cannot be deleted and you will see a lock icon next to them. To add elements to your form simply drag and drop them to the desired location."

See https://toolset.com/documentation/getting-started-with-toolset/publish-content-from-the-front-end/forms-for-creating-content/

However, I was able to delete the Title field, but it remained in the UI when I went to add a record. I have discovered that the reason for this is because in the "Edit Post Type" there is a checkbox that adds the title (among other options) even if you have deleted it from your form and your field group. If you uncheck the box, the title no longer appears when you are adding a record. So if unchecked, does this mean there is no title or does it mean that the title is assigned a value that the admin/user does not see, or does it retain the title as a null value?

...

Anyway, you guys are obviously very busy so I will check back on this in the future as it is not stopping my work.

Regards-

#1313879

(1) Are there required fields for a custom post type? If not, am I prepending the title field accidentally with a setting somewhere or what?
Hi, the title field is not required, nor are any of the other standard fields. You can adjust the fields that display in a custom post type by editing the custom post type in Toolset > Post types. Edit the post type and find the section "Sections to display when editing...". You can turn different options on or off here.

(2) Which form (post or user) would you suggest to use on the front end to allow the public to register as a new contractor to be added?
I would have a new User form to allow Guests to register for the site. Then I would use a new Post form to allow those new Users to create their own Contractor post. I would use a different post type to represent a Company, and set up a many-to-many relationship between Companies and Contractors.

(3) What's the difference in the fields that are added at the time I create a form and the fields that I manually add to a Custom Fields Group? There seems to be this duel set of fields whether I am creating a post form or a user form.
When you create a Form, the custom field groups that are associated with that post type (or User profile) will be automatically available in the Form builder. If you add new fields to that field group later, you would have to edit the Form and add those fields into the form to include them on the front-end.

There are also generic fields in Forms, which do not correspond to custom fields in the field group editor at all.

So if unchecked, does this mean there is no title or does it mean that the title is assigned a value that the admin/user does not see, or does it retain the title as a null value?
Usually WordPress automatically includes a title like "Auto Draft" in the database, but it's not visible in wp-admin if you disable the title field. If you want to override that default title, you can do so programmatically using custom code and the save_post hook. Or if the post is created with Forms, you can use the cred_save_data hook. I have documentation available about those if you'd like to know more.

#1314019

Thanks for the message. That all makes sense, and yes please, I would appreciate it if you would share the cred_save_data resources (URL, PDF, or whatever it is). That raises another issue... Seems like there has been some substantial reorganization and nomenclature changes while I was away. Where are we in that process? I mean, all the work you guys have been doing to improve and keep up is impressive, but I was wondering if there is any effort to create a fresh start for explaining everything, or are you just running around trying to patch the old docs and training materials so they make sense with the new ways/names? If there is a newly-created entry point, please provide the URL, as I think I'd like to run through it with a fresh take rather than trying to amend and annotate my rusty recollection of the way things were.

Thanks again -

#1314585

I would appreciate it if you would share the cred_save_data resources (URL, PDF, or whatever it is)
You can find documentation for this API and code examples available here: https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

I was wondering if there is any effort to create a fresh start for explaining everything, or are you just running around trying to patch the old docs and training materials so they make sense with the new ways/names?
Both of these, actually. Some documents are mostly still accurate and only require a few updates. Other documents didn't exist before.

Here's the entry point I recommend: https://toolset.com/documentation/
It has links to our training guides and reference documents, shortcode definitions, as well as programmer information about our APIs. I would also recommend subscribing to our blog to keep up with the latest updates as they are added: https://toolset.com/blog

#1315891

Christian, I'll look into the "cred" API soon.

Pointing me to the main documentation link with its numerous "Getting Started," "Tutorials," and "User Guides" links wasn't much of a tip, and reminded me why I became discouraged with Toolset (which was wp-types at that time). So with no good idea of where exactly it would be best to set a path for education these days, I thought I'd just revisit the "Toolset Forms training" site template.

If they aren't moved or discontinued, other Toolset users reading this will find the templates located here: https://discover-wp.com/site-templates/

Looking at those templates was very helpful in refreshing my memory, but raised concern since I also took your advice and visited the Toolset blog. And while I did not see a way to subscribe to the blog for new post notifications, I did see a discussion about the "recommended future-proof" idea of not using Layouts. So I'm wondering...

(1) Is there any update on how soon we can expect the new release (using blocks) to show up?

(2) How long will existing sites (using Layouts) be supported with support and software updates?

Thanks -

#1316351

(1) Is there any update on how soon we can expect the new release (using blocks) to show up?
You can install and use Toolset Blocks now if you'd like. It's available for download or automatic installation. Our developers are actively working on new features using the Block editor, like designing Views with real-time rendering in the editor. Block editor is very high priority for our developers now, but I don't have any concrete timelines available.

(2) How long will existing sites (using Layouts) be supported with support and software updates?
We will continue to support Layouts as long as clients want to use it. However, we expect that the Block editor will eventually make Layouts obsolete. New features will probably not be added to Layouts, and the developers' focus will be on the Block editor. With that being said, updates to resolve serious issues or to provide compatibility with other Toolset plugin updates may be released.

#1318207

Thanks for the assist.

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