Opened 16 years ago
Closed 16 years ago
#7216 closed enhancement (fixed)
remove_filter should allow all callback functions for a tag to be removed
Reported by: | filosofo | Owned by: | jacobsantos |
---|---|---|---|
Milestone: | 2.7 | Priority: | normal |
Severity: | normal | Version: | 2.6 |
Component: | General | Keywords: | has-patch remove_filter dev-feedback |
Focuses: | Cc: |
Description
Sometimes you want to remove lambda callback functions, and sometimes you want to remove all callback functions for a given action or filter hook, but currently you can't.
My patch allows you to remove all callback functions for a given tag, by specifying "all" as the function name: remove_filter('tag_name', 'all');
Attachments (2)
Change History (11)
#4
@
16 years ago
Why a new function? apply_filters
lets you pass "all" as the "tag," so this is parallel behavior. Performance reasons should not be a factor, because remove_filter
is not called enough to make a difference, and the check on that block should be pretty quick anyways.
Another function is just something else to have to remember.
#5
@
16 years ago
Branches are something to be avoided as much as possible. The CPU still has to decide: Well, do I go into the branch and start loading that code or should I skip it and load the code after.
Having its own separate function, would be a short body and be pretty sweet.
Suggestion: Create a new function for handling this behavior.