Not the OP, but I’ve fought Wordpress plenty of times as well. Probably the worst time was when I was writing a WP authentication plugin for my org. I was reading the docs when I ran into this gem[0]:
> 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 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.
[0] https://codex.wordpress.org/Class_Reference/WP_User