Custom Fields
Re-Envisioned
Support General Need a filter before save field Reply To: Need a filter before save field

#9005

pluginoven
Participant

It turns out the values can be easily filtered using the ´rwmb_value´ filter like so:

add_filter( 'rwmb_value', array( $this, 'uncheck_thruthiness' ), 20, 3 );
public function uncheck_thruthiness ( $new, $field, $old ) {
	if($field['id'] == 'truthiness' && !empty( $field['attributes']['mod_lock'] ) ){
		$new = '';
	}
        return $new;
}

I have a different issue now… This can be marked as resolved. I’ll open a new thread.