[wp-trac] [WordPress Trac] #17787: A bunch of filters and minor fixes
WordPress Trac
wp-trac at lists.automattic.com
Mon Jun 13 17:00:12 UTC 2011
#17787: A bunch of filters and minor fixes
-------------------------+-----------------------------
Reporter: 5ubliminal | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Plugins | Version: 3.2
Severity: normal | Keywords:
-------------------------+-----------------------------
First of all I removed the
{{{
unset($wp_filter); // in wp-settings.php
}}}
and setup a static counter in '''add_filter()'''. On the first run, it
will reset the $wp_filter to an empty array(). It will also make sure on
each run the $wp_filter is an array().
This allows plugins to hook even inside the wp-config.php if it includes
the wp-includes/plugin.php file.
I added 1-2 filters to all functions that list plugin files. This way
plugins can alter these lists. Still got a lot to test but the filters in
place do absolutely no damage, but provide me the testing ground for some
deeper modifications.
I also added 2 tweaks I carry on from version to version. A filter like
this:
{{{
apply_filters( "query_template", $templates, $type );
}}}
located in the get_query_template() function allowing unitary management
of template file array regardless of future WordPress changes.
Also added an extra parameter to login_init action in wp-login.php.
Special actions exist for each $action but needed the general one to tell
me where it's calling from.
{{{
do_action( 'login_init', $action ); // This was missing
}}}
Changes are commented and my name attached to each change so you know who
to blame or ask questions.
Thanks.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/17787>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list