- Wordpress Web Application Development(Third Edition)
- Rakhitha Nimesh Ratnayake
- 186字
- 2021-07-09 19:52:36
Scenario 3 - a project management application
Let's consider a much more advanced scenario in creating a relationship between post types. Assume that we have been assigned to build a project management application with WordPress. We can match projects to a custom post type. Project-specific details such as project manager, duration, and cost will be stored in the wp_postmeta table. It's not ideal to use the wp_postmeta table to store project tasks since each project contains multiple tasks, and a single project task can contain its own attributes and values. Therefore, we create another custom post type to store project tasks, and all the task-related data is stored inside the wp_postmeta table. Finally, we can associate projects with tasks using taxonomies or a separate custom table.
So far, we have discussed three completely different scenarios in real-world applications, and we were able to match all the requirements with custom post types. Now, you should understand the importance of these two tables in web application development. In the next chapter, we will continue our exploration of custom post types and the use of the wp_posts and wp_postmeta tables.