You are here

field_placeholder.install in Field placeholder 7

Same filename and directory in other branches
  1. 7.2 field_placeholder.install

Contains update functions for Field placeholder.

File

field_placeholder.install
View source
<?php

/**
 * @file
 * Contains update functions for Field placeholder.
 */

/**
 * Update placement of placeholder in $instance for i18n_field integration.
 */
function field_placeholder_update_7101() {
  $all_instances = field_info_instances();
  foreach ($all_instances as $entity_type => $bundle) {
    foreach ($bundle as $name => $instances) {
      foreach ($instances as $instance) {
        if (isset($instance['settings']['placeholder'])) {
          $instance['placeholder'] = $instance['settings']['placeholder'];
          unset($instance['settings']['placeholder']);
          field_update_instance($instance);
        }
      }
    }
  }
  return t('Field placeholder maintenance tasks finished');
}

Functions

Namesort descending Description
field_placeholder_update_7101 Update placement of placeholder in $instance for i18n_field integration.