Hi @julianoe,
As of the last update in January 2022, directly adding elements to the formatting toolbar of a core block in WordPress through PHP is not a standard practice. WordPress primarily relies on JavaScript for such customizations due to the dynamic nature of the block editor. While it might appear complex, using JavaScript ensures a more flexible and interactive user experience. For the latest information, check the WordPress documentation or community discussions for updates on PHP-based toolbar customization.
Hope this information is helpful.