A field looks empty in the editor, but your template treats it as having a value — or the reverse. This is the difference between an empty value and a zero.
Repeater and Relationship require Nexter Pro Extensions 4.8.0 or later. On Nexter Extension alone neither type can be added, and an existing field of either type is locked: the value is kept read-only and is never cleared on save.
What It Does
Some field types store an unset value as 0 or as an empty string, and PHP’s empty() treats both the same. That is what makes the two states look identical in a template when they are not.
Before You Start
- A template reading a field value.
- A post where the field is unset, and one where it genuinely holds zero.
Test It Correctly
- Compare against an empty string rather than using
empty().
- For a reference field — post object, relationship, user — check the target still exists rather than trusting the ID.

- For a true/false field, test the value directly. Do not compare against the string
'false', which is truthy in PHP.
- If you need to tell “never answered” from “answered no”, use a radio field with three choices instead of a toggle.
Display the Value
The safe comparisons:
<?php
$price = nxt_field_value( 'price' );
// wrong: 0 is a real price, but empty() calls it empty
if ( ! empty( $price ) ) { /* ... */ }
// right
if ( '' !== $price && null !== $price ) {
echo esc_html( $price );
}
// a toggle
if ( nxt_field_value( 'featured' ) ) { /* ... */ }
Limitations
- A cleared reference field can store
0and read back as though it holds a value. Check the target exists before using it. - A false toggle is stored as an empty string rather than
0, so ameta_querylooking for0will not find it. Query for an empty value or useNOT EXISTS.
Troubleshooting
A price of 0 disappears from my template
empty() treats 0 as empty. Compare with '' !== instead.
A relationship renders a blank item
The linked post was deleted and only its ID remains. Guard with get_post_status() before rendering.










