Quantcast
Viewing all articles
Browse latest Browse all 294882

Default tokens for token types

Problem

Token types are objects that cannot just be converted to a particular piece of output automatically. Example: node_tokens() handles node:created tokens, and instead of letting system_tokens() (which defines the date type) handle the replacement entirely, it only does so for node:created:property tokens. node:created is replaced by node_tokens(), and so is node:changed.

Solution

Require data types to have a default property, so the token API can relieve hook_tokens() implementations of some of their responsibilities and create more consistency among replacements.


Viewing all articles
Browse latest Browse all 294882

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>