Several users have requested that I build a “rating” field type for Easy Content Types that will allow administrators / editors to apply a rating to a post or custom post type entry. This sort of field type would be exceptionally useful for users running review websites, such as book, movie, or game reviews. I have gone ahead and built a simple star/number rating field type, and would like to share with all of you the methods used to build such a field type. It is a little complicated, but if you’re already familiar with adding new field types in Easy Content Types, you won’t have any problems.
If you have not already watched my tutorial on how to register custom meta field types in the plugin, then go watch it now.
The field types we will be creating look like this:
When rendered on the front end, our fields will look like this (when using the automatic display meta function):
In the video, I walk you through all of the functions (except the last two; the reason is explained in the video) and describe the process of setting up the new field type. To aide you in building your own rating field type, the complete code is below: