nxt/format_value runs every time a field value is read for display. It is where you change how a value comes out without changing what is stored.
What It Does
The filter receives the formatted value, the field definition and the object ID. Whatever you return is what the template gets.
Before You Start
- Nexter Extension 4.9.0 or later with Content Fields enabled.
- Somewhere to add PHP — a child theme’s
functions.php, a small plugin, or a Nexter code snippet. - You know the field or post type key you want to affect.
Filter a Displayed Value
- Add a filter on
nxt/format_valuewith three arguments.

- Test
$field['name']so the change applies only to the field you mean.
- Return the original
$valueunchanged for everything else.
- Load a post that has the field and confirm the output changed.
When to Use It
- Adding a currency symbol or unit without storing it.
- Falling back to a site-wide default when a post leaves a field empty.
- Normalising a value that was imported inconsistently.
Display the Value
Formatting a price for display, leaving the stored number alone:
<?php
add_filter( 'nxt/format_value', function ( $value, $field, $object_id ) {
if ( 'price' !== $field['name'] || '' === $value ) {
return $value; // always return the original
}
return '£' . number_format_i18n( (float) $value );
}, 10, 3 );
Limitations
- This changes display only. The stored value is untouched, so sorting and
meta_querystill see the raw value. - It runs on every read. Keep the callback cheap.
- It does not run for
nxt_field_value_raw(), which is the point of that function.
Troubleshooting
Every field changed, not just mine
The $field['name'] test is missing or wrong. Return $value untouched for fields you are not targeting.
Values disappeared
A code path in the callback returns nothing. Every branch must return a value.










