iLexN
9/6/2017 - 1:30 AM

create new tokens

create new ctools tokens

<?php

/**
 * Implements hook_token_info().
 */
function scmp_content_token_info() {
  $info['tokens']['site']['topic_term_name'] = array(
    'name' => t('The term name of topic.'),
    'description' => t('The term name of topic for node or term page.'),
  );
}


/**
 * Implements hook_tokens().
 *
 * Note: a default value for $tokens is set to avoid foreach notice error
 */
function scmp_content_tokens($type, $tokens, array $data = array(), array $options = array()) {
  //check source
}
<?php

//clear cache for token
function scmp_content_update_7091{
    token_clear_cache();
}