I have been a supporter of WordPress for years, and will continue to support it’s mission to democratize publishing. So many of the ideas WordPress has included over the years have been amazing, but with the theme.json
file having such an important role it was a swing and a miss. For the next official theme, we should go back to a mostly using functions.php
and maybe have the theme.json
file be there to give metadata about the theme but serve a much smaller role than it does now. I think Sam Hermes gets this just right in his article at https://samhermes.com/posts/slowly-backing-away-from-theme-json .
The theme.json
file is a cool idea, but the execution is not very cool. Having the file allows you to edit a lot of features of WordPress that most people do not need and takes away features that people do need while potentially alienating long-time users who are used to the way things worked plus not bringing in new ones. Making the user base smaller and not growing it is contrary to the mission “democratize publishing”, since that implies allowing more people to publish using WordPress. I suggest we only use the theme.json
for limited metadata about the theme, and we go back to using functions.php
for the bulk of the theme configuration. I don’t know if anyone will take that suggestion seriously but I do want to emphasize that I am not saying to get rid of anything, I am just suggesting we make it less important and say that we should use the functions.php file for everything code.
At work, I work on several WordPress classic sites and one WordPress site that uses a theme.json
. The theme.json
site is not bad, and from the front-end user view it is no different from any of the other sites. On the admin side of the site is a different story, it does have a few differences which I find ok but it also has things missing or more difficult which I do not find ok. Thankfully, we can and did use a supplementary functions.php
with the theme.json
file.
It sounds efficient to have your different kinds of code and theme functionality simplified by being set with one language and all sent from one place by json which is what the theme.json
file does. The way it sounds and the practical application of an idea are two different things. In reality, if someone is editing a json file and writing code then they are a developer. A random non-developer is never going to write a code file in the filesystem of their web server, and that should not happen. The WordPress platform out of the box with plugins allows users to make semi-complex sites without any assistance already, but that is kind of the limit of what a normal person can make without hiring some help.
Can a regular person wire their house with electricity? Maybe in a few cases but the answer is generally no so they hire a specialist to do it. Who is WordPress core making this theme editing process better for? Some random, unassisted person is not going to write code, so why are we making it easier for them? The users the theme.json
is made to help will never use it. Let’s pivot away from using theme.json
to do theme code adjustments in favor of using it to store metadata (like theme headers and possibly a simplified way of adding fonts to the theme) and use the functions.php
file to add/modify the code.