Support General How to filter value of spesific field before saving it to DB Reply To: How to filter value of spesific field before saving it to DB

#9350
foundbutlostfoundbutlost
Participant

Ah silly me, how could i've missed that :'D, but still i'm not too familiar with the code explanation.

$new = apply_filters( "rwmb_{$field['id']}_value", $new, $field, $old );

Where do i put this code? how come even i have $old when i have nothing as i'm inserting a new data? which variable holding this value “this is my value”? because i need to do str replace on it.

i'm really confused, usually when i want to change output of plugin i just simply use add filter and a function like this:

add_filter( 'the_content', 'filter_my_content' );
function filter_my_content( $content ) {
some code here
}

please help me