nxt_field_values() returns every field value on an object at once, keyed by field name. It saves a call per field when you need most of them.
What It Does
One call, one array. Each key is a field name and each value is already formatted according to that field’s return-format setting.
Before You Start
- Nexter Extension is active.
- You know the field’s Field Name.
- You are editing a template or a plugin.
Read Them All
- Call
nxt_field_values(), optionally with an object.
- Treat the result as an array keyed by field name.
- Check a key exists before using it — a field with no value may be absent rather than empty.
- Escape each value for the context you print it into.
Display the Value
Reading, and the raw variant:
<?php
$all = nxt_field_values();
if ( isset( $all['reference'] ) ) {
echo esc_html( $all['reference'] );
}
// every value on another post
$other = nxt_field_values( 123 );
// unformatted, ignoring conditional logic
$raw = nxt_field_values_raw();
Limitations
- Only fields from groups whose location rules match the object are included.
- Fields hidden by conditional logic are omitted.
nxt_field_values_raw()ignores that. - Reading everything is not always cheaper. If you need two fields out of thirty, two calls to
nxt_field_value()are clearer.
Troubleshooting
A field I expected is not in the array
Either it has no value, or its conditional logic is unmet. Try nxt_field_values_raw() to see what is actually stored.
The array is empty
No field group’s location rules match this object, so there are no fields to read.










