All the documentation I've encountered discusses overriding pluggable function via your plugin.

What if you're doing theme development instead?

My functions.php requires another file that overrides the `get_user_by()` function, defined in `pluggable.php`.

If I omit the `if( function_exists() )` call I get the "Cannot redeclare..." error.

If I include the `if( function exists() )` call, then I get no error, but of course my function is then ignored, since the pluggable version exists.

Based on Dominic's awesome post on [the WordPress startup order][1], it's clear that `pluggable.php` is loaded _before_ your theme's `functions.php` and so forth, so that explains the error.

So the question is - how can you take advantage of that nice pluggable architecture from within a theme, without resorting to writing plugins which then must be bundled or installed with the theme?

**Further notes**: So it appears that the argument is that themes should not be trying to do what plugins do. But that argument is over four years old (according to the 4-digit trac number). I'd love to hear from some heavy hitters whether this philosophy still applies, given the complex topology of today's theme development landscape. I'd like to believe we've evolved since then.


  [1]: http://humanshell.net/2011/08/14/wordpress-initialization/