[wp-trac] [WordPress Trac] #35357: Introduce did_filter()
WordPress Trac
noreply at wordpress.org
Thu Jan 7 23:51:04 UTC 2016
#35357: Introduce did_filter()
-------------------------+-----------------------------
Reporter: mordauk | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Plugins | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
I think there should a `did_filter( $tag )` function that mimics the
existing `did_action( $tag )` function.
While actions and filters are pretty much the same thing, it turns out
that you can't actually use `did_action()` to detect when a filter has
been run.
{{{
function did_filter( $tag = '' ) {
global $wp_filter;
if ( ! isset( $wp_filter[ $tag ] ) ) {
return 0;
}
return $wp_filter[ $tag ];
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/35357>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list