What is a Meta Box in WordPress? It’s an interface to interact with metadata. Bam, that’s it.
In the back-end, WordPress has built-in meta boxes for categories, publishing, tags, and the featured image. You can build a custom one which has the HTML form fields to provide an interface to work with the custom fields (metadata).
For example, this is the meta box I built for the episode configuration:
What do you notice? It has a checkbox, select dropdown, and text input fields. Bingo, it’s a form with form fields. Remember what I taught you previously. Custom fields are these fields, as they are user interface-centric, whereas metadata is code and data centric. Same pieces of interface.
Your functions are bloated. Put them on a diet. Think "skinny" and "as few lines as possible."
Total Lab Runtime: 02:03:31
- 1 Lab Introductionfree 09:52
- 2 What is a Custom Field?free 15:55
- 3 What is a Meta Box?free 06:24
- 4 Project: Add a Subtitlepro 07:16
- 5 The Databasepro 11:48
- 6 Get Subtitle Post Metadatapro 15:26
- 7 Add Subtitle to Genesis Themepro 12:19
- 8 Update an Existing Custom Fieldpro 17:15
- 9 Add a New Custom Fieldpro 07:19
- 10 Delete a Custom Fieldpro 10:13
- 11 More Custom Field Functionspro 06:25
- 12 Wrap it Upfree 03:19