Two functions clear a value, and they do different things. nxt_erase_field_value() removes it. nxt_reset_field() puts the field back to its configured default.
What It Does
Erasing leaves the field empty. Resetting leaves it holding whatever Default Value the field was configured with — which may not be empty at all.
Before You Start
- A field with a value saved.
- A logged-in user who can edit the object — the same capability check as saving.
Clear a Value
- To empty the field, call
nxt_erase_field_value().

- To restore its configured default, call
nxt_reset_field().
- Pass the object if it is not the current post.
- Check the return value — both are capability-checked and can refuse.
Display the Value
The two, side by side:
<?php
// leave the field empty
nxt_erase_field_value( 'price', $post_id );
// put it back to the field's Default Value
nxt_reset_field( 'price', $post_id );
Limitations
- Both check the current user’s capability to edit the object. Under WP-CLI there is no current user, so pass
--user=1. - Erasing a reference field can leave the meta holding
0rather than nothing, which reads as a value. Test with'' !==rather thanempty(). - Neither removes the field itself. The field stays in the group; only its value on that object changes.
Troubleshooting
Reset left a value behind
That is the field’s Default Value. Use erase if you want it genuinely empty.
Nothing happens under WP-CLI
No logged-in user means the capability check refuses. Add --user=1.










