#5015 closed defect (bug) (worksforme)
Add_Filter priority fails with some hooks
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | Priority: | high | |
Severity: | normal | Version: | 2.3 |
Component: | General | Keywords: | plugin add_filter |
Focuses: | Cc: |
Description
The ability to give a plugin function that is being added as a filter fails if it is called by hooking in an array:
For example:
add_filter('the_content', 'my_filter', 1); works fine
add_filter('the_content', array(&$this, 'filter'), 1); fails
Change History (4)
#3
@
16 years ago
You are quite right - no bug in the add_filter code. Still something funny going on though.
Basically I've fixed my issue so I'll leave this ticket closed but..
I have a preg_replace looking for (<p>)(\n)*<!--subscribe2-->(\n)*(</p>) which worked fine with no priority set and with the priority set as 10. Lower than this it fails unless I change my regualr expression to <!--subscribe2-->.
Note: See
TracTickets for help on using
tickets.
Cannot reproduce. Here was my test code:
Output was:
... as expected.
Try doing a
die('Worked')
or amail('you@example.com', 'the_content', 'Worked');
in your method.