You are here

function commerce_bulk_commerce_bulk_term_new_alter in Commerce Bulk 8

Implements hook_TYPE_alter().

Allows to alter an taxonomy term fields data.

See also

\Drupal\commerce_bulk\Plugin\Action\TermDuplicate::submitConfigurationForm()

File

./commerce_bulk.module, line 76
Contains commerce_bulk.module.

Code

function commerce_bulk_commerce_bulk_term_new_alter(TermInterface &$term, &$name, $data) {

  // Do required changes optionally using $data passed.
  // Enable core `Serialization' module to decode 'json' or 'xml' data passed on
  // the VBO action configuration page and use that to alter $term / $name:
  // static $array_data;
  // $array_data = $array_data ?: \Drupal::service('serializer')->decode($data, 'json');
  // Note that $term will be saved later by the hook caller.
}