You are here

function field_placeholder_update_7202 in Field placeholder 7.2

Adds use_title_as_placeholder setting default.

File

./field_placeholder.install, line 31
Contains update functions for Field placeholder.

Code

function field_placeholder_update_7202() {
  $all_instances = field_info_instances();
  foreach ($all_instances as $entity_type => $bundle) {
    foreach ($bundle as $name => $instances) {
      foreach ($instances as $instance) {
        if (isset($instance['placeholder']) && !isset($instance['use_title_as_placeholder'])) {
          $instance['use_title_as_placeholder'] = FALSE;
          field_update_instance($instance);
        }
      }
    }
  }
  return t('Field placeholder maintenance tasks finished');
}