Quantcast
Viewing all articles
Browse latest Browse all 291783

'unify' hook_token_info()

hook_token_info() is used to expose data objects and their properties. The odd thing about this hook is that the data objects are declared separately from their tokens, which causes some confusion.

I attached a patch that updates system.api.php with a reworked hook_token_info() and hook_token_info_alter(). It groups data types and their tokens together, and moved the function of needs-data 'properties' to array keys, so the whole array structure is simper, and so is the documentation. Note that the patch indeed only updates the documentation. Once a consensus has been reached, the 7 hook_token_info() implementations in core can be changed, as well as the code that calls these hooks.


Viewing all articles
Browse latest Browse all 291783

Trending Articles



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