[wp-hackers] overriding pluggable.php functions

Gaarai gaarai at gaarai.com
Sat Jan 10 02:13:12 GMT 2009


I have to say Will, that's a fantastic idea. Great work.

Chris Jean
http://gaarai.com/
http://wp-roadmap.com/



Stephen Rider wrote:
> It's almost like putting a do_action at the end of every pluggable 
> function -- but more powerful and cheaper. :)
>
> Stephen
>
> On Jan 9, 2009, at 2:09 PM, Will Norris wrote:
>
>> I've been thinking about how it would work if pluggable.php were 
>> instead made up of functions like:
>>
>> if (!function_exists('wp_authenticate')) {
>>    function wp_authenticate($username, $password) {
>>        return _wp_authenticate($username, $password) {
>>    }
>> }
>>
>> function _wp_authenticate($username, $password) {
>>    /* all the normal authentication logic */
>> }
>>
>> So basically, the functions which can be replaced by plugins don't 
>> actually include any logic whatsoever, they simply call "private" 
>> counterparts.  This way, I can override wp_authenticate, but can 
>> still fall back by calling _wp_authenticate myself.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>


More information about the wp-hackers mailing list