Flying memes

How to extend WordPress Types Plugin and create new field types

Types is a very well made WordpPress plugin that basically allows the creation of new custom post types and custom fields directly from the WordPress administration area without the need to write extra PHP code.

When creating a custom field the plugin offer a wide choice of field types, ranging from file to datpicker to wyswyg editors. However it can happen that you need to add extra field types such as, in my case, a colorpicker.

Surprisingly, once discovered the basic mechanisms of the plugin, this can be done pretty easily without having to work directly on the plugin files. I’ve prepared a gist (https://gist.github.com/sandropaganotti/5693719) that adds a new ‘colorpicker’ field type to Types. The file can be loaded through a theme functions.php file or within a custom plugin.