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

8.0.x
Alex Pott 2014-06-08 17:41:24 -05:00
parent c711a45796
commit f9dc1f1da8
2 changed files with 3 additions and 9 deletions

View File

@ -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',
);

View File

@ -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',
);