4

I'm trying to debug creating a token. How to programmatically create a custom token in a module shows me how to create them.

Is there a way to display all available tokens? I'm trying to test if my module actually created that token.

2
  • Do you mean to show the value of the tokens, or to list all the available tokens?
    – avpaderno
    Commented Jan 26, 2012 at 21:53
  • Good point. I'll specify.
    – chrisjlee
    Commented Jan 26, 2012 at 21:56

1 Answer 1

4

There's a function in the token module called token_get_list() which is:

A helper function that retrieves all currently exposed tokens, and merges them recursively.

It invokes hook_token_list() for all modules so should give you every single token defined in the site.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.