acf_field_select::update_value
This filter is appied to the $value before it is updated in the db
Method of the class: acf_field_select{}
No Hooks.
Returns
$value. - the modified value
Usage
$acf_field_select = new acf_field_select(); $acf_field_select->update_value( $value, $post_id, $field );
- $value(required)
- .
- $post_id(required)
- .
- $field(required)
- .
Changelog
| Since 3.6 | Introduced. |
acf_field_select::update_value() acf field select::update value code ACF 6.0.4
function update_value( $value, $post_id, $field ) {
// Bail early if no value.
if ( empty( $value ) ) {
return $value;
}
// Format array of values.
// - Parse each value as string for SQL LIKE queries.
if ( is_array( $value ) ) {
$value = array_map( 'strval', $value );
}
// return
return $value;
}