Let's say we want to create custom token which looks like this:
Our token consits of three parts. First one "youtube" is the type of our token. Second "video" is the name of token. Third one "otdEhyGrujQ" is the id of our youtube video we want to embedd. This is the representation of our token:
Let our module name is youtube_video.
To achieve that we need to use three functions: hook_token_info(), hook_tokens() and hook_theme().
First is hook_token_info: