The oik-fields plugin provides an easy to use Application Programming Interface (API) to define custom fields for custom post types. It also provides shortcodes for displaying field values and forms for accepting values for new entries. There is one API to register fields, another to associate them to post types.
- bw_register_field() – Register a field named $field_name of type $field_type with title $field_title and additional values $args
- bw_register_field_for_object_type() – Register a field named $field_name for object type $object_type
oik-fields supports the display and entry of ten basic field types: checkbox, currency, date, email, noderef, numeric, select – including multi-select, text, textarea, URL
Support is provided for specific fields: post_title, post_content, excerpt, bw_header_image
Each field has 3 basic attributes – name, type and label – and supports a number of optional attributes. Additional optional attributes vary depending on the field type.
Hooks – actions and filters
oik-fields uses two hooks to allow other plugins to provide support for their own custom field types.
The oik base API also provides support for defining custom taxonomies: tags and categories and associating them to post types.
Building your own CPTs
Using the oik-fields plugin, in combination with the oik base plugin you can, for example, create a simple contact form plugin that will log messages from your site’s visitors, along with any additional fields that you define for the custom post type. OR you may want to create fixtures for a golf society, a TODO list or a catalogue of premium plugins.
The oik-types plugin delivers a simple admin UI that uses oik-fields to enable the creation of custom post types, fields and taxonomies without having to write any PHP code. The oik base plugin delivers powerful shortcodes to display the data in a variety of formats.
- oik-fields – requirements and implementation overview
- oik-fields – Field Types
- oik-fields – Field Attributes
- oik-fields – Implementing a new custom field
- oik-fields – unique features