[wp-hackers] Proposal for the plugin architecture

Francesco Terenzani f.terenzani at gmail.com
Fri Feb 23 09:12:34 GMT 2007


Hi all,
I've revisited the plugin architecture of Wordpress 2.1
(wp-includes/plugin.php) and now it seems working faster and the code
is simpler.

For add an item to $wp_filter the actual method is:

(Loops to prevent duplicate filters)

$wp_filter[$tag]["$priority"][] = array('function'=>$function_to_add,
'accepted_args'=>$accepted_args);

This is the method I suggest to add an item (Loops are not required!):

$wp_filter[$tag][$priority][serialize($function_to_add)] =
array('function' => $function_to_add, 'accepted_args' =>
$accepted_args);

Using this structure we can simplify every function in
wp-includes/plugin.php and the performances look better :-)

An example of plugin functions modified for this structure are here:
http://www.terenzani.it/wp-hacker/wp-includes/plugin.phps

Could it be added in the Wordpress core?

Thanks

-- 
GT Team Globalwarming Awareness2007
http://www.gt-globalwarming-awareness2007.org/
http://globalwarming-awareness2007.bloster.altervista.org/

http://www.terenzani.it/


More information about the wp-hackers mailing list