I have a custom post type called "stock" and each post is going to have a stock_id, stock_name, stock_description and stock_available fields,...I would like to have defaults for these fields so the user doesn't have to load them on each new item. Is there a way?
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
A simple way to do that would be to use Verve Meta Boxes plugin which lets you define a metabox with a simple UI (no code is needed) and you have an options to set the default value for each field. |
|||||||||||
|
|
Two angles of approach:
1) More user friendly: would be to make a meta box for these custom fields. Your meta box for these custom fields would contain the See add_meta_box for more information. 2) At minimum, you can hook onto the 'save_post' action, and check if there's a value, and if not store that as the meta value:
|
|||
|