Add Custom Tokens in Custom Module for Drupal 9

grayscale photography of person holding coin or token

In Drupal 9, you can create custom tokens using the Token API for your custom module. The Token API provides a central API for modules to use to provide tokens. Tokens are placed into text by using the [type:token] syntax, where type is the machine-readable name of the token type, and token is the machine-readable name of the token within the type.

Drupal: An Open Source Content Management System for Websites and Applications

Drupal is a popular open-source content management system (CMS) that has been around for over two decades. It is widely used for creating websites, intranets, and web applications, and is known for its scalability, security, and flexibility. With a large and active community of developers and users, Drupal has a wealth of modules and themes available that can be easily integrated into projects.