Development process and code for our ESRM Soil Sample CPT plugin
For the ESRM project, we collect soil samples which are then tested for the presence of certain bacterial strains. We need to take data for several stages of this process, including the stage of soil collection, soil testing, the final results of bacterial growth, and then possibly further data analysis if the bacteria we found is of particular interest. The same data is collected by every student researcher in our study. This type of study is well-suited for using a CMS for data collection since the CPT is the same for each student researcher. The fields that we need to contain in our CPT are the following.
For the overall structure of our CPT plugin, we followed the best practices of the Boilerplate plugin. However, we did not use much of the code in the Boilerplate, because we are developing a CPT in particular.
For the CPT code, we utilizes the resources from the repository of the WordPress Plugin Development Cookbook, chapter 4. That chapter explains development of a Custom Post Type, in this case for a Book Review. the final development is in the 9th iteration of the CPT . For our soil sample, we refactored this file into a separate file to contain the definition and actions of the CPT in soil_sample_actions.php.
The final structure that we have for the soil sample CPT...