简体   繁体   中英

How To Create WordPress Custom Post Type With OPTIONAL Fields

When creating a custom post type in wordpress for dynamic items, such as portfolio items, some fields may be unsable for certain portfolio items. But, if you leave this field out, there will be a validation error in wordpress, because the field is a necessary according to WordPress. How can someone make certain fields in the custom post type optional? So no validation errors occur?

To make the field optional, simply go to admin dashboard, scroll down the left navigation panel and click Custom Fields. Then, click on the post type you'd like to edit. Click on a field you want to make optional, and you will see a check box for yes or no -- click no. Click Update. The field will no longer be required!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM