A Cozmoslabs Product
Documentation / Custom Fields Creator

Custom Fields Creator

Overview of Custom Fields Creator

WCK Custom Fields Creator offers an UI for setting up Custom Meta Boxes with Custom Fields for your Posts, Pages or Custom Post Types.
Custom fields are stored as post meta and all the data handling is done with ajax.

WordPress Creation Kit - Custom Fields Creator - Overview

After we setup our Custom Meta Box we can use the Custom Field that is attached to our Custom Post Type.

WordPress Creation Kit - Custom Fields Creator - Custom Meta Box inside Custom Post Type

Custom Fields Creator – Meta Box Arguments

For the Custom Meta Box we can set the following Arguments: Group Name, Post Type, Repeater, Sortable, Post ID and Page Template.

Meta Box Arguments:

  1. Group name (required) – The name of the group. It is the name by which you will query the data in the front-end. Must be unique, only lowercase letters, no spaces and no special characters
  2. Post Type (required) – What Post Type the Meta Box should be attached to
  3. Repeater – Whether the Meta Box is a Single Custom Meta Box or Repeater Custom Meta Box. By default it is a Single Meta Box
  4. Sortable – Whether the entries are sortable or not. This is valid for Repeater Meta Boxes
  5. Post ID – ID of the post on which the Meta Box should appear
  6. Page Template – If post type is “page” you can further select a Page Template. The Meta Box will only appear on the page that has that selected Page Template.

WordPress Creation Kit - Custom Fields Creator - Meta Box Arguments

Single Custom Meta Boxes and Repeater Custom Meta Boxes

You can create 2 types of Custom Meta Boxes: Single Custom Meta Boxes and Repeater Custom Meta Boxes (for Repeater Custom Fields).

Custom Fields Creator – Meta Box Fields

All the Custom Fields created with CFC are displayed inside a Custom Meta Box.

Custom Fields Arguments:

  1. Field Title (required) – The title of the custom field
  2. Field Type (required) – The type of the custom field
  3. Description – The description of the field
  4. Required – Whether the field is required or not
  5. Default value – Default value of the field

WordPress Creation Kit - Custom Fields Creator - Meta Box Fields

Custom Fields Creator – Fields Types

WCK makes it really easy to add Default and Extra Fields Types inside your Custom Meta Box. Under the Meta Box Fields tab, you’ll find an intuitive interface for Adding, Editing, Deleting or Reordering fields.

You can add a field to the Custom Meta Box by simply choosing one of the supported fields from the Field Type drop-down.

Once you select a field type you’ll need to fill in the field properties:

WordPress Creation Kit - Custom Fields Creator - Default and Extra Fields

Default Fields Types

All Free and Premium versions of WordPress Creation Kit supports the following Default Fields Types:

  1. Text – Used to add limited information
  2. Textarea – Used to add consistent information
  3. Select – Used to choose data from a predefined list
  4. Checkbox – Used to check an option from a list
  5. Radio – Used to select an option from a radio button group
  6. Upload – Used for uploading Files or Images via the WordPress Media Uploader
  7. WYSIWYG Editor – Used for adding and editing information with HTML
  8. Heading – Used to create sections of Custom Fields
  9. Colorpicker – Allows a color to be selected via a JavaScript popup
  10. Currency Select – Allows a currency to be selected from a dropdown list
  11. Phone – Used for adding a phone number
  12. Timepicker – Used for selecting the hour / minute from a dropdown list
  13. HTML – Used to add HTML content
  14. Number – Used to add a number

Extra Fields Types

WordPress Creation Kit, both PRO and Hobbyist versions, supports a wide range of Extra Fields Types:

  1. Datepicker – Allows a date to be selected via a JavaScript popup calendar
  2. Country Select – Used to create a dropdown list with all countries
  3. User Select – Displays a dropdown that lets you select one of the users registered on your website
  4. Custom Post Type Select – Displays a dropdown of all available entries for a specific Custom Post Type
  5. Map – Allows to add a Map in a Post, Page or Custom Post Type

Manage existing Custom Fields with WCK

If, before using WCK, you already have a couple of fields attached to Post, Pages or CPTs being saved in the database and want to display and manage them using WCK, all you need to do is create a Meta Box and add each one of them under the Meta Box Fields tab, give them the same meta-name and check the “Overwrite existing” option.

WordPress Creation Kit - Custom Fields Creator - Overwrite Existing

This way you’ll be able to display and update existing fields with WCK.

Reorder Fields

Meta Box Fields provides a Drag & Drop interface for sorting and reordering both default and extra fields.

You’ll be able to easily mix default and extra fields to fit your needs.

WordPress Creation Kit - Custom Fields Creator - Reorder Fields

This way you don’t need to worry about the order in which you create your Custom Fields. You can always rearrange them to your liking.

Edit or Delete a Field

Editing or deleting a field is done by clicking the Edit or Delete buttons from the fields table.

WordPress Creation Kit - Custom Fields Creator - Edit or Delete a Field

Add HTML tags inside Input fields

To add HTML tags inside input fields like the Text field you will need to use the following custom code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
add_filter( 'wck_pre_sanitize_value', 'wck_bypass_default_sanitization' );
function wck_bypass_default_sanitization( $bool ){
return true;
}
 
add_filter( 'wck_sanitize_value', 'wck_sanitize_value_change', 10, 2 );
function wck_sanitize_value_change( $value, $meta_name ){
if( is_array( $value ) )
$value = array_map( 'wck_basic_sanitize_value', $value );
else
$value = wck_basic_sanitize_value( $value );
 
return $value;
}
 
function wck_basic_sanitize_value( $string ){
return preg_replace( '/<script\b[^>]*>(.*?)<\/script>/is', '', $string );
}

The Ultimate Membership Bundle

Combine the power of Profile Builder with Paid Member Subscriptions to set up user registration, memberships, and recurring revenue.

Get 25% off with the bundle

Help & Support

We’re here to help you every step of the way.

Open a Support Ticket