> The semantics seem rather fuzzy. If id is a WP_User or other object, or an array of properties, it seems to clone it without touching the cache. Otherwise if id is a number it seems to try to read it possibly from the cache, or from the database using ->get_data_by(), which can also update the cache. If id is empty it reads by login name.
I realized that if even the offical documentation didn’t know what Wordpress was doing, I definitely had no hope.
-The plug-in APIs have been largely written by accretion, making them confusing and hard to grok. I always vaguely feel like I’m doing something wrong, that this shouldn’t be this difficult... Furthermore, API functions are inconsistently named, and return hard-to-predict datatypes.
- The theme tools are similarly confusing, and can make simple tasks take a lot of time. Sure, you just have to create magicfilename.php/css and put this magic snippet into it - but the discoverability in that is pretty garbage and results in a lot of hacks that solve things in the wrong way.
- Using other people’s plugins was a crapshoot, as plugin conflicts were (are?) pretty common. For a casual user plugins are a massive footgun, as WP makes it easy to install decade-old unmaintained junk plugins full of security holes.
Compare all of this to Drupal, which while far from perfect actually tries to design sane APIs and solid code, and iterates on it to correct their mistakes.
Wordpress is a workhorse on the web, but it is a complex, inconsistent mess full of weird edge cases. It is much harder to introspect, debug and reason about than it should be. You need tons of specific, specialized knowledge to interact with it as a developer.
The reason for that seems to be this: it is built with people in mind who cannot code, but the reality is that for many cases this doesn’t suffice, so you end up with a hodgepodge.