Haben unser altes Custom-Fields-Plugin auf drei Seiten ersetzt, ohne eine Vorlage zu ändern.
DE
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.
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' ); // localisedOutput
19,99
rangeSchieberegler (Bereich)
In the editor
Schieberegler mit Anzeige des aktuellen Werts.
In the template
nik_get_field( 'd_range' );Output
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' );Output
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
radioRadio
In the editor
Optionsfelder.
In the template
nik_get_field( 'd_radio' );Output
button_groupSchaltflächengruppe
In the editor
Eine Auswahl, dargestellt als Reihe von Schaltflächen.
In the template
nik_get_field( 'd_buttons' );Output
checkboxCheckbox
In the editor
Ein einzelnes Auswahlkästchen.
In the template
nik_get_field( 'd_checkbox' ); // boolOutput
truetrue_falseWahr / Falsch
In the editor
Ein Ein-/Aus-Schalter mit eigener Beschriftung.
In the template
nik_get_field( 'd_truefalse' ); // boolOutput
trueimageBild
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
{
"id": 899
}icon_pickerIcon-Picker
In the editor
Ein Dashicon oder eine Bild-URL.
In the template
nik_the_field( 'd_icon' );Output
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' ); // arrayOutput
{
"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
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
{
"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' ); // formattedOutput
06.08.2026
date_time_pickerDatum und Uhrzeit
In the editor
Datum mit Uhrzeit.
In the template
nik_the_field( 'd_datetime' );Output
time_pickerUhrzeit
In the editor
Tageszeit.
In the template
nik_get_field( 'd_time' );Output
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 Winterpage_linkSeitenlink
In the editor
Gleiche Auswahl, aber der Wert ist der Permalink.
In the template
nik_the_field( 'd_pagelink' );Output
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
| # | name | Wert | icon |
|---|---|---|---|
| 1 | Gewicht | 1.2 | ![]() |
| 2 | Länge | 48 | ![]() |
| 3 | Volumen | 0.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

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 readOutput
accordionAkkordeon
In the editor
Einklappbarer Bereich im Editor. Enthält keinen Wert.
In the template
// nothing to readOutput
messageMitteilung (kein Wert)
In the editor
Eine dem Editor angezeigte Notiz. Enthält keinen Wert.
In the template
// nothing to readOutput
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 = liveC Bidirektionale Beziehung
Das Verknüpfen einer Seite schrieb die andere. Auf der verknüpften Seite wurde nichts eingegeben.
nik_get_field( 'd_linked' ) // hereD 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()E Andere Ziele
Die gleiche API, adressiert mit 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_1' )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' )G Gutenberg-Block
Ein Block, dessen Attribute eine Feldgruppe sind; seine Vorlage liest sie mit derselben API.
H Shortcodes
Für Redakteure, die im Inhaltsbereich statt in Vorlagen arbeiten.
[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 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' )'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 pro Feldgruppe. Diese Gruppe hat es aktiviert.
| Endpunkt | was es macht |
|---|---|
GET /wp-json/wp/v2/pages/1834 | Die Core-Antwort erhält ein nik_fields-Objekt |
GET /wp-json/nik-cf/v1/fields/page/1834 | Werte in ihrem Rückgabeformat |
POST /wp-json/nik-cf/v1/fields/page/1834 | Werte schreiben |
GET /wp-json/nik-cf/v1/field-groups | die Konfiguration selbst |
GET /wp-json/nik-cf/v1/options/ncf-demo-options | eine 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.

