#16245 closed defect (bug) (duplicate)
remove_filter makes filters applied after that useless
Reported by: | oddoneout | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | major | Version: | 3.0.4 |
Component: | Plugins | Keywords: | |
Focuses: | Cc: |
Description (last modified by )
Here's some codes:
function run_once() { remove_filter( current_filter(), __FUNCTION__ ); return 'test'; } add_filter( 'foobar', 'run_once' ); function another_filter() { return 'test again'; } add_filter( 'foobar', 'another_filter', 11 ); echo apply_filters( 'foobar', '' );
The result of this is 'test' instead of 'test again'. This might happen with remove_action, I haven't tested that function though.
Change History (5)
#2
@
14 years ago
- Description modified (diff)
- Severity changed from normal to major
Reproduced with r17312.
Cleaned up the example code slightly.
#3
follow-up:
↓ 4
@
14 years ago
- Milestone Awaiting Review deleted
- Resolution set to duplicate
- Status changed from new to closed
Actually, it's the same error as described in #9968
#5
in reply to:
↑ 4
@
14 years ago
Replying to Denis-de-Bernardy:
Replying to scribu:
Actually, it's the same error as described in #9968
It's actually a completely different problem. But you're welcome to come up with a solution nonetheless if PHP5 allows it. ;-)
Woops, my bad. The joys of using tabbed-browsing and reading the wrong window. Never mind that. It's the same one indeed. :-D
Note: See
TracTickets for help on using
tickets.
Related: #9968