Commit f9dc1f1d authored by alexpott's avatar alexpott

Issue #1911768 by Xano: Added Make token and token type descriptions optional.

parent c711a457
......@@ -28,7 +28,6 @@ function node_token_info() {
);
$node['type'] = array(
'name' => t("Content type"),
'description' => t("The type of the node."),
);
$node['type-name'] = array(
'name' => t("Content type name"),
......@@ -36,7 +35,6 @@ function node_token_info() {
);
$node['title'] = array(
'name' => t("Title"),
'description' => t("The title of the node."),
);
$node['body'] = array(
'name' => t("Body"),
......@@ -62,7 +60,6 @@ function node_token_info() {
// Chained tokens for nodes.
$node['created'] = array(
'name' => t("Date created"),
'description' => t("The date the node was posted."),
'type' => 'date',
);
$node['changed'] = array(
......@@ -72,7 +69,6 @@ function node_token_info() {
);
$node['author'] = array(
'name' => t("Author"),
'description' => t("The author of the node."),
'type' => 'user',
);
......
......@@ -2518,7 +2518,8 @@ function hook_tokens_alter(array &$replacements, array $context) {
* - types: An associative array of token types (groups). Each token type is
* an associative array with the following components:
* - name: The translated human-readable short name of the token type.
* - description: A translated longer description of the token type.
* - description (optional): A translated longer description of the token
* type.
* - needs-data: The type of data that must be provided to
* \Drupal\Core\Utility\Token::replace() in the $data argument (i.e., the
* key name in $data) in order for tokens of this type to be used in the
......@@ -2534,7 +2535,7 @@ function hook_tokens_alter(array &$replacements, array $context) {
* tokens, each token item is keyed by the machine name of the token, and
* each token item has the following components:
* - name: The translated human-readable short name of the token.
* - description: A translated longer description of the token.
* - description (optional): A translated longer description of the token.
* - type (optional): A 'needs-data' data type supplied by this token, which
* should match a 'needs-data' value from another token type. For example,
* the node author token provides a user object, which can then be used
......@@ -2558,7 +2559,6 @@ function hook_token_info() {
);
$node['title'] = array(
'name' => t("Title"),
'description' => t("The title of the node."),
);
$node['edit-url'] = array(
'name' => t("Edit URL"),
......@@ -2568,12 +2568,10 @@ function hook_token_info() {
// Chained tokens for nodes.
$node['created'] = array(
'name' => t("Date created"),
'description' => t("The date the node was posted."),
'type' => 'date',
);
$node['author'] = array(
'name' => t("Author"),
'description' => t("The author of the node."),
'type' => 'user',
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment