Skip To Content

SCROLL DOWN FOR MORE

Case study
CARBON FIELDS

CarbonFields - WordPress
Custom Fields Library

Carbon Fields makes it easy to create custom fields for post types, options pages, taxonomies, users, comments, navigation menus, and custom widgets. You can even define dynamic Gutenberg blocks without touching javascript.

Case 4
WHAT IS CARBON FIELDS

Carbon Fields was started as our internal custom fields library in 2009, when the state of the WordPress’ plugin ecosystem was not as developed as it is today.

Heading

How It All Began

The initial version of Carbon Fields was just a bunch of classes and a little bit of jQuery “magic”. We took some ideas for the field definition API from the Django Models. That turned out quite well — the client API for building containers and blocks has not changed for the past decade(even though we rewrote the underlying PHP and javascript several times).

Pre-plugin Stage

For a few years, we used the library internally. Throughout this time, we built thousands of clients’ projects based on it. We were gradually extending Carbon Fields so it became fully-featured tool comparable to other plugins in the field. By 2015, Carbon Fields was rewritten twice (once to include Complex Fields and another time to use Backbone instead of jQuery). In 2017, we rewrote the plugin once again in order to use React.

CARBONFIELD AS A PLUGIN

Carbon Fields was released as a plugin at the beginning of 2016. There are two main reasons why we did it:

Contributing to the community

We truly believe that whatever goes around, comes around. This is why, setting aside time to work on projects that will not only give value back to the community, but will also contribute to the progress of the Web as a whole, is one of our priorities.

We saw an opportunity

We felt that the WordPress’ core team hasn’t been prioritizing developers’ problems, instead they kept their focus on the end user’s needs. With this in mind we saw an opportunity to create a free, dev-oriented solution, that gives developers control over the custom fields generation.

Carbon fields 1
FIELD AND CONTAINER TYPES

Types of fields and containers you can create:

  • Text FieldYou can use the text field to input labels, URLs, numbers or a single line texts.
  • Textarea FieldYou can use the textarea field to input multiple rows of text, scripts, styles, custom HTML code. It also supports a row parameter which you can use in order to control the initial height of the field.
  • Checkbox Field
    You can use the checkbox field in order to add true/false options and build conditional logic.
  • Set Field
    You can use the set field in order to add multiple checkboxes. This way you will provide the administrator with the ability to select multiple options.
  • Radio Field
    You can use the radio buttons field in order to provide multiple options to the administrator. Also, it is useful when building a more complex conditional logic.
  • Color Field
    You can use the color field in order to select a color for the font or for a page/section background.
  • Select Field
    You can use the select field with many purposes. For example, you can build conditional logic using it, background type, or specify the listing post type.
  • Multiple Select Field
    You can use the multiple select field in order to provide the administrator to select multiple options. For example, multiple post types for a listing page.
  • Radio Image FieldYou can use the radio image field in order to provide the administrator with the ability to choose a pre-defined featured image for a page/post.
  • Date Field
    You can use the date field in order to achieve different features or filtrations based on the post date. Or for example, if you create a custom post type called Events you can use the date field for it.
  • Date & Time Field
    This field is similar to the date field, however, it includes a time along with the date.
  • Time Field
    This field is similar to the Date and Date & Time fields, however, it supports only time selection.
  • Rich Text Field
    The rich text fields is a WYSIWYG editor. You can use it in order to prepare and format text content easily.
  • Association Field
    You can use this field in order to create an association between a page/post and a specific set of pages/posts. The field is working with any post types and taxonomies.
  • File Field
    You can use the file field in order to upload different files to the post/page and provide them to the users.
  • Image Field
    You can use the image field in order to upload an image to the post/page and use it in a certain section during the coding.
  • Media Gallery Field
    You can use the media gallery field in order to build different galleries on a page or a post.
  • Gravity Form Field
    You can use this field in order to select a certain Gravity form and use it on the page/post. However, it is mandatory to use the Gravity Forms plugin, otherwise, no options will be shown.
  • Map Field
    You can use this field in order to build a location map in your website. The field will store the data with the right format in order to be easily used to create a Google Map. Also, the field is related to the Google Maps functionality and an API key should be added.
  • Sidebar Field
    You can use this field in order to select a unique sidebar for every page/post.
  • Complex Field
    You can use this field in order to build a repeater of fields for a specific section (features or services). However, via the complex field, you can also build a section builder. Section Builder means a repeater field that contains different groups and each group contains fields for a specific section.
  • Post Meta
    The Post Meta container is being used for a custom fields declaration. Post Meta containers can be attached to all post types. For example, Post, Page, WooCommerce Product, Media Attachment, Comments, etc. Also, a certain post meta container can be attached to a certain post or page template only.
  • Term Meta
    The Term Meta container has similar functionality as the Post Meta container, however, it can be attached to all the taxonomies including the custom ones. For example, Category, Tags, WooCommerce Product Category, etc.
Feedback

A WordPress Custom Fields library every developer must use.