You are here

function readmorecontrol_update_7001 in Read More Control 7

Update node instance settings if required.

File

./readmorecontrol.install, line 53
Standand installation functions.

Code

function readmorecontrol_update_7001() {
  $node_bundles = field_info_instances('node');
  foreach ($node_bundles as $bundle => $bundle_instances) {
    foreach ($bundle_instances as $field_name => $instance) {
      if (isset($instance['readmorecontrol_ignore'])) {
        $instance['readmore_behaviour'] = $instance['readmorecontrol_ignore'] ? 'ignore' : 'process';
        unset($instance['readmorecontrol_ignore']);
        field_update_instance($instance);
      }
    }
  }
}