Nik Custom Fields — Live Demo
Every field type the plugin registers, and every documented call, executed live on this page. Left: what the editor works with and the call a template makes. Right: what that call returned.
A The field types
One block per type: what the editor sees, the call, the result.
textText
In the editor
Single-line input. Placeholder, character limit, default value, prefix/suffix.
In the template
nik_the_field( 'd_text' );Output
textareaTextarea
In the editor
Multi-line plain text. Row count is a setting.
In the template
nik_the_field( 'd_textarea' );Output
Plain text, kept verbatim.
Ampersands & quotes "survive" — no double escaping.
numberNumber
In the editor
Numeric input with min, max, step and a prefix. Decimals are kept.
In the template
nik_get_field( 'd_number' ); // float
nik_the_field( 'd_number' ); // localisedOutput
19.99
rangeRange slider
In the editor
Slider with a live value readout.
In the template
nik_get_field( 'd_range' );Output
emailEmail
In the editor
Email input. An address that does not validate is rejected on save.
In the template
nik_the_field( 'd_email' );Output
urlURL
In the editor
URL input.
In the template
nik_the_field( 'd_url' );passwordPassword
In the editor
Masked input. Stored verbatim, printed as dots.
In the template
nik_the_field( 'd_password' );Output
wysiwygRich text (editor)
The gallery below is a [gallery] shortcode typed into the editor.
In the editor
The real WordPress editor: TinyMCE, Quicktags, media button. Shortcodes run on output.
In the template
nik_the_field( 'd_wysiwyg' );Output
Rich text from the real WordPress editor — lists, links and shortcodes all work:
- TinyMCE and Quicktags
- Media button
selectSelect
In the editor
Dropdown. A value outside the configured list is refused.
In the template
nik_get_field( 'd_select' );Output
radioRadio
In the editor
Radio buttons.
In the template
nik_get_field( 'd_radio' );Output
button_groupButton group
In the editor
One choice, shown as a row of buttons.
In the template
nik_get_field( 'd_buttons' );Output
checkboxCheckbox
In the editor
A single tick box.
In the template
nik_get_field( 'd_checkbox' ); // boolOutput
truetrue_falseTrue / False
In the editor
On-off switch with its own label.
In the template
nik_get_field( 'd_truefalse' ); // boolOutput
trueimageImage
In the editor
Media library picker. Return format: id, URL, or the full array.
In the template
$img = nik_get_field( 'd_image' );
echo $img['sizes']['medium'];Output
{
"id": 933,
"alt": "",
"width": 800,
"height": 800
}galleryGallery
In the editor
Several images, reorderable by dragging.
In the template
foreach ( nik_get_field( 'd_gallery' ) as $img ) {
echo $img['sizes']['thumbnail'];
}Output




4 images
fileFile
In the editor
Any attachment, not just images. Allowed extensions are a setting.
In the template
nik_the_field( 'd_file' );Output
{
"id": 938
}icon_pickerIcon picker
In the editor
A dashicon or an image URL.
In the template
nik_the_field( 'd_icon' );Output
oembedoEmbed
In the editor
A URL from any oEmbed provider; the embed is resolved on output.
In the template
nik_the_field( 'd_oembed' );Output
linkLink
In the editor
URL, link text and an open-in-new-tab switch.
In the template
nik_the_field( 'd_link' ); // <a> with rel=noopener
nik_get_field( 'd_link' ); // arrayOutput
{
"url": "https://products.nikdimon.com/products/nik-custom-fields/",
"title": "Product page",
"target": "_blank"
}color_pickerColour
In the editor
Native swatch plus a hex box.
In the template
nik_the_field( 'd_color' );Output
google_mapGoogle Map
In the editor
Latitude, longitude and an address.
In the template
nik_the_field( 'd_map' );
nik_get_field( 'd_map' );Output
{
"address": "Kyiv, Ukraine",
"lat": 50.4501,
"lng": 30.5234,
"zoom": 14
}date_pickerDate
In the editor
Date only. Stored sortable, printed in the site format.
In the template
nik_get_field( 'd_date', false, false ); // raw
nik_the_field( 'd_date' ); // formattedOutput
06.08.2026
date_time_pickerDate and time
In the editor
Date with a time of day.
In the template
nik_the_field( 'd_datetime' );Output
time_pickerTime
In the editor
Time of day.
In the template
nik_get_field( 'd_time' );Output
post_objectPost object
In the editor
Search picker for one entry. Nothing is loaded until you type.
In the template
$post = nik_get_field( 'd_postobject' );
echo $post->post_title;Output
WP_Post #701 Images auto convert — 1page_linkPage link
In the editor
Same picker, but the value is the permalink.
In the template
nik_the_field( 'd_pagelink' );Output
relationshipRelationship (posts)
In the editor
Search picker for several entries, reorderable.
In the template
foreach ( nik_get_field( 'd_relationship' ) as $post ) {
echo get_permalink( $post );
}Output
taxonomyRelationship (terms)
In the editor
Search picker over terms of any taxonomy.
In the template
nik_get_field( 'd_taxonomy' );Output
{
"term_id": 1,
"name": "Без рубрики",
"slug": "%d0%b1%d0%b5%d0%b7-%d1%80%d1%83%d0%b1%d1%80%d0%b8%d0%ba%d0%b8",
"term_group": 0,
"term_taxonomy_id": 1,
"taxonomy": "category",
"description": "",
"parent": 0,
"count": 0,
"filter": "raw"
}userRelationship (users)
In the editor
Search picker over site users.
In the template
nik_get_field( 'd_user' );Output
{
"id": 1,
"login": "PaperAdmin1873",
"display_name": "PaperAdmin1873",
"email": "dmitrij.nikolaenko.91@gmail.com",
"roles": [
"administrator"
]
}groupGroup
In the editor
Several fields kept together under one name.
In the template
$d = nik_get_field( 'd_group' );
echo $d['w'] . '×' . $d['h'] . ' ' . $d['u'];Output
{
"w": 120,
"h": 80,
"u": "cm"
}repeaterRepeater
In the editor
Rows of subfields, added and reordered by the editor.
In the template
while ( nik_have_rows( 'd_specs' ) ) : nik_the_row();
echo nik_get_row_index();
echo nik_get_sub_field( 'name' );
echo nik_get_sub_field( 'value' );
endwhile;Output
| # | name | value | icon |
|---|---|---|---|
| 1 | Weight | 1.2 | ![]() |
| 2 | Length | 48 | ![]() |
| 3 | Volume | 0.75 | — |
repeaterRepeater
The same type again, nested — this is the case most alternatives get wrong.
In the editor
A repeater inside a repeater. Nesting has no fixed limit.
In the template
while ( nik_have_rows( 'd_sections' ) ) : nik_the_row();
echo nik_get_sub_field( 'title' );
while ( nik_have_rows( 'items' ) ) : nik_the_row();
echo nik_get_sub_field( 'label' );
endwhile;
endwhile;Output
Before release
- ✅ Run the test suites
- ✅ Update the changelog
- ⬜ Tag the release
After release
- ⬜ Publish the product page
flexibleFlexible content
In the editor
The editor picks from named layouts, in any order, as many times as needed.
In the template
while ( nik_have_rows( 'd_flex' ) ) : nik_the_row();
if ( 'hero' === nik_get_row_layout() ) { … }
endwhile;Output

cloneClone (reuse a group)
In the editor
The fields of another group, reused without copying their configuration.
In the template
$a = nik_get_field( 'd_clone' );
echo $a['street'] . ', ' . $a['city'];Output
Khreshchatyk 1, Kyiv 01001
{
"street": "Khreshchatyk 1",
"city": "Kyiv",
"zip": "01001"
}tabTab / separator
In the editor
Splits a long group into tabs in the editor. Holds no value.
In the template
// nothing to readOutput
accordionAccordion
In the editor
Collapsible section in the editor. Holds no value.
In the template
// nothing to readOutput
messageMessage (no value)
In the editor
A note shown to the editor. Holds no value.
In the template
// nothing to readOutput
B Conditional logic
Rules run in the editor. A hidden field keeps its value.
nik_get_field( 'd_conditional' ) // shown only while Select = liveC Bidirectional relationship
Linking one side wrote the other. Nothing was entered on the linked page.
nik_get_field( 'd_linked' ) // hereD Field objects and bulk reads
nik_get_field_object( 'd_select' ){
"key": "d_select",
"uid": "nikf_69f0cbb6950774f9644d",
"label": "Select",
"name": "d_select",
"type": "select",
"instructions": "",
"required": false,
"width": 100,
"choices": [
"draft",
"review",
"live"
],
"settings": null,
"value": "live"
}nik_get_sub_field_object( 'value' ) // inside a row{
"key": "value",
"label": "Value",
"type": "number",
"width": 50,
"required": 0
}nik_get_fields()E Other targets
The same API, addressed with option / user_N / term_N.
nik_get_field( 'o_company', 'option' )nik_get_field( 'o_logo', 'option' )
nik_get_field( 'u_job', 'user_1' )nik_get_field( 'c_tagline', 'term_49' )NULLF Field group declared in code
Registered from a PHP file, so the configuration can live in git.
nik_add_local_field_group( array(
'key' => 'ncf-local',
'fields' => array( array( 'key' => 'l_badge', 'type' => 'text' ) ),
) );
nik_get_field( 'l_badge' )G Gutenberg block
A block whose attributes are a field group; its template reads them with the same API.
H Shortcodes
For editors who work in the content area rather than in templates.
[nik_cf_field field="d_text"][nik_cf_field field="nope" default="fallback"][nik_cf_gallery field="d_gallery" size="thumbnail"]



[nik_cf_group group="ncf-address"]I Querying by field value
Values are stored under a stable id, so nik_meta_key() turns the name you know into the key WP_Query needs.
nik_meta_key( 'd_specs', '0_name' )'meta_query' => array( array(
'key' => nik_meta_key( 'd_specs', '0_name' ),
'value' => 'Weight',
) )nik_meta_key( 'd_sections', '0_items_1_label' ) // any depth'meta_key' => nik_meta_key( 'd_number' ),
'orderby' => 'meta_value_num'J REST API
Opt-in per field group. This group has it enabled.
| endpoint | what it does |
|---|---|
GET /wp-json/wp/v2/pages/939 | core response gains a nik_fields object |
GET /wp-json/nik-cf/v1/fields/page/939 | values in their return format |
POST /wp-json/nik-cf/v1/fields/page/939 | write values |
GET /wp-json/nik-cf/v1/field-groups | the configuration itself |
GET /wp-json/nik-cf/v1/options/ncf-demo-options | an options page |
K Front-end form
The same renderers and validation as a meta box. Only shown to someone who may edit this page.
Hidden: a front-end form needs a logged-in user with edit_post on this page.
That check runs when rendering and again when accepting the submission.
Other plugins
Nik Images Auto Convert: automatic WebP conversion and compression
How to set up the Nik Images Auto Convert plugin: choosing a format and…
Nik Analytics Pro website and sales analytics
Privacy-friendly analytics that stores everything in your own database: visits, geography, UTM sources, funnels…
Nik Wishlist & Ajax Mini Cart — wishlist and ajax cart for WooCommerce
A wishlist for guests and customers, a sliding mini cart and ajax add to…
Nik Shipping UA — Nova Poshta & Ukrposhta for WooCommerce
Nova Poshta and Ukrposhta delivery for WooCommerce: branch, parcel locker and courier pickers at…
Nik Google Reviews
Show your latest Google reviews the legal way — live through the official Places…
Nik AI Search & Filters — AJAX product filters and catalogue search for WooCommerce
Filters and a search box that finds what shoppers mean, not just what they…
We use cookies and similar technologies for site analytics and advertising (Google, Meta). Choose whether to allow them. Privacy policy


