You are here

function _range_update_instances in Range 7

Helper function. Applies given callback for every field instance.

Loops through all field instances. Executes given callback with each instance as a parameter.

Parameters

string $callback: Callback to execute for every field instance.

6 calls to _range_update_instances()
range_update_7001 in ./range.install
Updates range field instances' settings.
range_update_7002 in ./range.install
Updates range field instances' settings.
range_update_7003 in ./range.install
Updates range field instances' settings.
range_update_7004 in ./range.install
Updates range field formatters' settings.
range_update_7005 in ./range.install
Introduces new field formatter.

... See full list

File

./range.install, line 54
Install, update and uninstall functions for the range field module.

Code

function _range_update_instances($callback) {
  $instances = field_info_instances();
  foreach ($instances as $entity_type) {
    foreach ($entity_type as $bundle) {
      foreach ($bundle as $instance) {
        if (function_exists($callback) && $callback($instance)) {
          field_update_instance($instance);
        }
      }
    }
  }
}