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.

36 field types registered, 36 present on this page. Every registered type is on this page.

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

A complete custom fields toolkit

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.

numberNummer

In the editor

Numerische Eingabe mit min, max, Schritt und einem Präfix. Dezimalstellen werden beibehalten.

In the template

nik_get_field( 'd_number' );   // float
nik_the_field( 'd_number' );   // localised

Output

19.99
19,99

rangeSchieberegler (Bereich)

In the editor

Schieberegler mit Anzeige des aktuellen Werts.

In the template

nik_get_field( 'd_range' );

Output

65

emailE-Mail

In the editor

E-Mail-Eingabe. Eine Adresse, die nicht validiert, wird beim Speichern abgelehnt.

In the template

nik_the_field( 'd_email' );

urlURL

In the editor

URL-Eingabe.

In the template

nik_the_field( 'd_url' );

passwordPasswort

In the editor

Maskierte Eingabe. Wortwörtlich gespeichert, als Punkte angezeigt.

In the template

nik_the_field( 'd_password' );

Output

••••••••

wysiwygRich-Text (Editor)

Die untenstehende Galerie ist ein [gallery] Shortcode, der im Editor eingegeben wurde.

In the editor

Der echte WordPress-Editor: TinyMCE, Quicktags, Media-Button. Shortcodes werden bei der Ausgabe verarbeitet.

In the template

nik_the_field( 'd_wysiwyg' );

Output

Rich-Text aus dem echten WordPress-Editor — Listen, Links und Shortcodes funktionieren alle:

  • TinyMCE und Quicktags
  • Media-Button

selectAuswahl

In the editor

Dropdown. Ein Wert außerhalb der konfigurierten Liste wird abgelehnt.

In the template

nik_get_field( 'd_select' );

Output

live

radioRadio

In the editor

Optionsfelder.

In the template

nik_get_field( 'd_radio' );

Output

high

button_groupSchaltflächengruppe

In the editor

Eine Auswahl, dargestellt als Reihe von Schaltflächen.

In the template

nik_get_field( 'd_buttons' );

Output

m

checkboxCheckbox

In the editor

Ein einzelnes Auswahlkästchen.

In the template

nik_get_field( 'd_checkbox' );   // bool

Output

true

true_falseWahr / Falsch

In the editor

Ein Ein-/Aus-Schalter mit eigener Beschriftung.

In the template

nik_get_field( 'd_truefalse' );  // bool

Output

true

imageBild

In the editor

Auswahl aus der Mediathek. Rückgabeformat: ID, URL oder das vollständige Array.

In the template

$img = nik_get_field( 'd_image' );
echo $img['sizes']['medium'];

Output

{
    "id": 909,
    "alt": "",
    "width": 800,
    "height": 800
}

galleryGalerie

In the editor

Mehrere Bilder, per Drag & Drop neu anordbar.

In the template

foreach ( nik_get_field( 'd_gallery' ) as $img ) {
    echo $img['sizes']['thumbnail'];
}

Output

4 Bilder

fileDatei

In the editor

Jeglicher Anhang, nicht nur Bilder. Erlaubte Dateiendungen sind eine Einstellung.

In the template

nik_the_field( 'd_file' );

Output

icon_pickerIcon-Picker

In the editor

Ein Dashicon oder eine Bild-URL.

In the template

nik_the_field( 'd_icon' );

Output

dashicons-star-filled

oembedoEmbed

In the editor

Eine URL von einem beliebigen oEmbed-Anbieter; das Embed wird bei der Ausgabe aufgelöst.

In the template

nik_the_field( 'd_oembed' );

Output

linkLink

In the editor

URL, Linktext und ein Umschalter zum Öffnen in neuem Tab.

In the template

nik_the_field( 'd_link' );        // <a> with rel=noopener
nik_get_field( 'd_link' );        // array

Output

Produktseite
{
    "url": "https://products.nikdimon.com/products/nik-custom-fields/",
    "title": "Product page",
    "target": "_blank"
}

color_pickerFarbe

In the editor

Native Farbfeld plus ein Hex-Feld.

In the template

nik_the_field( 'd_color' );

Output

#2271b1

google_mapGoogle-Map

In the editor

Breitengrad, Längengrad und eine Adresse.

In the template

nik_the_field( 'd_map' );
nik_get_field( 'd_map' );

Output

Kiew, Ukraine
{
    "address": "Kyiv, Ukraine",
    "lat": 50.4501,
    "lng": 30.5234,
    "zoom": 14
}

date_pickerDatum

In the editor

Nur Datum. Sortierbar gespeichert, im Seitenformat ausgegeben.

In the template

nik_get_field( 'd_date', false, false );  // raw
nik_the_field( 'd_date' );                // formatted

Output

2026-08-06
06.08.2026

date_time_pickerDatum und Uhrzeit

In the editor

Datum mit Uhrzeit.

In the template

nik_the_field( 'd_datetime' );

Output

06.08.2026 17:30

time_pickerUhrzeit

In the editor

Tageszeit.

In the template

nik_get_field( 'd_time' );

Output

09:15:00

post_objectPost-Objekt

In the editor

Suchauswahl für einen Eintrag. Nichts wird geladen, bis Sie tippen.

In the template

$post = nik_get_field( 'd_postobject' );
echo $post->post_title;

Output

WP_Post #701 Hoodie Thermal Winter

page_linkSeitenlink

In the editor

Gleiche Auswahl, aber der Wert ist der Permalink.

In the template

nik_the_field( 'd_pagelink' );

Output

(empty)

relationshipBeziehung (Beiträge)

In the editor

Suchauswahl für mehrere Einträge, neu anordbar.

In the template

foreach ( nik_get_field( 'd_relationship' ) as $post ) {
    echo get_permalink( $post );
}

taxonomyBeziehung (Begriffe)

In the editor

Suchauswahl über Begriffe beliebiger Taxonomien.

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": 5,
    "filter": "raw"
}

userBeziehung (Benutzer)

In the editor

Suchauswahl für Seitenbenutzer.

In the template

nik_get_field( 'd_user' );

Output

{
    "id": 1,
    "login": "PaperAdmin1873",
    "display_name": "PaperAdmin1873",
    "email": "dmitrij.nikolaenko.91@gmail.com",
    "roles": [
        "administrator"
    ]
}

groupGruppe

In the editor

Mehrere Felder, zusammen unter einem Namen gehalten.

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

Zeilen mit Unterfeldern, vom Redakteur hinzugefügt und neu geordnet.

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

#nameWerticon
1Gewicht1.2
2Länge48
3Volumen0.75

repeaterRepeater

Der gleiche Typ erneut, verschachtelt — das ist die Stelle, an der die meisten Alternativen falsch liegen.

In the editor

Ein Repeater innerhalb eines Repeaters. Verschachtelung hat keine feste Grenze.

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

Vor der Freigabe

  • ✅ Testsuiten ausführen
  • ✅ Änderungsprotokoll aktualisieren
  • ⬜ Release taggen

Nach der Veröffentlichung

  • ⬜ Produktseite veröffentlichen

flexibleFlexibler Inhalt

In the editor

Der Editor wählt aus benannten Layouts, in beliebiger Reihenfolge, so oft wie nötig.

In the template

while ( nik_have_rows( 'd_flex' ) ) : nik_the_row();
    if ( 'hero' === nik_get_row_layout() ) { … }
endwhile;

Output

hero Flexibler Inhalt, drei Layouts
quote Jede Zeile wird entsprechend ihrem eigenen Layout aufgelöst. — Die Dokumentation
Spalten
Erste Zelle
Zweite Zelle
Dritte Zelle

cloneKlonen (Gruppe wiederverwenden)

In the editor

Die Felder einer anderen Gruppe, wiederverwendet ohne Kopieren ihrer Konfiguration.

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 / Trenner

In the editor

Teilt eine lange Gruppe im Editor in Tabs auf. Enthält keinen Wert.

In the template

// nothing to read

Output

Konzipiert: nur Layout

accordionAkkordeon

In the editor

Einklappbarer Bereich im Editor. Enthält keinen Wert.

In the template

// nothing to read

Output

Konzipiert: nur Layout

messageMitteilung (kein Wert)

In the editor

Eine dem Editor angezeigte Notiz. Enthält keinen Wert.

In the template

// nothing to read

Output

Konzipiert: nur Layout

B Bedingte Logik

Regeln werden im Editor ausgeführt. Ein ausgeblendetes Feld behält seinen Wert.

nik_get_field( 'd_conditional' )   // shown only while Select = live
Sichtbar, weil Select "live" ist

C Bidirektionale Beziehung

Das Verknüpfen einer Seite schrieb die andere. Auf der verknüpften Seite wurde nichts eingegeben.

nik_get_field( 'd_linked' )                    // here
[1835]

D Feldobjekte und Massenabrufe

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()
47 Felder: tab_basics, d_message, d_accordion, d_text, d_textarea, d_number, d_range, d_email, d_url, d_password, d_wysiwyg, tab_choices …

E Andere Ziele

Die gleiche API, adressiert mit option / user_N / term_N.

nik_get_field( 'o_company', 'option' )
NikDimon Produkte
nik_get_field( 'o_logo', 'option' )
while ( nik_have_rows( 'o_socials', 'option' ) ) …
nik_get_field( 'u_job', 'user_1' )
Plugin-Autor
nik_get_field( 'c_tagline', 'term_1' )
Alles, was sonst nirgendwo abgelegt ist

F Im Code deklarierte Feldgruppe

Von einer PHP-Datei registriert, sodass die Konfiguration in Git gespeichert werden kann.

nik_add_local_field_group( array(
    'key'    => 'ncf-local',
    'fields' => array( array( 'key' => 'l_badge', 'type' => 'text' ) ),
) );
nik_get_field( 'l_badge' )
In PHP deklariert

G Gutenberg-Block

Ein Block, dessen Attribute eine Feldgruppe sind; seine Vorlage liest sie mit derselben API.

Haben unser altes Custom-Fields-Plugin auf drei Seiten ersetzt, ohne eine Vorlage zu ändern.
A. Entwickler ★★★★★

H Shortcodes

Für Redakteure, die im Inhaltsbereich statt in Vorlagen arbeiten.

[nik_cf_field field="d_text"]
A complete custom fields toolkit
[nik_cf_field field="nope" default="fallback"]
fallback
[nik_cf_gallery field="d_gallery" size="thumbnail"]
[nik_cf_group group="ncf-address"]

I Abfragen nach Feldwert

Werte werden unter einer stabilen ID gespeichert, sodass nik_meta_key() den Namen, den Sie kennen, in den Schlüssel umwandelt, den WP_Query benötigt.

nik_meta_key( 'd_specs', '0_name' )
_nik_cf_uid_nikf_659b3011241c91f7612f_0_name
'meta_query' => array( array(
    'key'   => nik_meta_key( 'd_specs', '0_name' ),
    'value' => 'Weight',
) )
Nik Custom Fields — live demo
nik_meta_key( 'd_sections', '0_items_1_label' )   // any depth
Nik Custom Fields — live demo
'meta_key' => nik_meta_key( 'd_number' ),
'orderby'  => 'meta_value_num'
Nik Custom Fields — live demo

J REST-API

Opt-in pro Feldgruppe. Diese Gruppe hat es aktiviert.

Endpunktwas es macht
GET /wp-json/wp/v2/pages/1834Die Core-Antwort erhält ein nik_fields-Objekt
GET /wp-json/nik-cf/v1/fields/page/1834Werte in ihrem Rückgabeformat
POST /wp-json/nik-cf/v1/fields/page/1834Werte schreiben
GET /wp-json/nik-cf/v1/field-groupsdie Konfiguration selbst
GET /wp-json/nik-cf/v1/options/ncf-demo-optionseine Optionsseite

K Frontend-Formular

Die gleichen Renderer und Validierungen wie eine Meta-Box. Nur Personen angezeigt, die diese Seite bearbeiten dürfen.

Versteckt: Ein Frontend-Formular benötigt einen angemeldeten Benutzer mit edit_post auf dieser Seite. Diese Prüfung läuft beim Rendern und erneut beim Akzeptieren der Einsendung.

Danke, Ihre Anfrage wurde gesendet