Skip to content

Instantly share code, notes, and snippets.

@angry-dan
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save angry-dan/bcf02d2d8f1572a6a10f to your computer and use it in GitHub Desktop.

Select an option

Save angry-dan/bcf02d2d8f1572a6a10f to your computer and use it in GitHub Desktop.
Create custom tokens (Drupal token_custom module) with an update hook.
<?php
$token = new stdClass();
$token->machine_name = 'machine-name-like-this';
$token->name = 'Name like this';
$token->description = 'Description like this';
$token->type = 'bundle_name';
$token->content = 'Default value';
$token->format = 'filtered_html';
$token->is_new = TRUE;
token_custom_save($token);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment