acf_field_select::load_value
Filters the $value after it is loaded from the db.
Method of the class: acf_field_select{}
No Hooks.
Returns
mixed.
Usage
$acf_field_select = new acf_field_select(); $acf_field_select->load_value( $value, $post_id, $field );
- $value(mixed) (required)
- The value found in the database.
- $post_id(int|string) (required)
- The post_id from which the value was loaded.
- $field(array) (required)
- The field array holding all the field options.
Changelog
| Since 3.6 | Introduced. |
acf_field_select::load_value() acf field select::load value code ACF 6.8.8
public function load_value( $value, $post_id, $field ) {
// Return an array when field is set for multiple.
if ( $field['multiple'] ) {
if ( acf_is_empty( $value ) ) {
return array();
}
return acf_array( $value );
}
// Otherwise, return a single value.
return acf_unarray( $value );
}