[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,

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' =>

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:

Could it be added in the Wordpress core?


GT Team Globalwarming Awareness2007


More information about the wp-hackers mailing list