Ticket #4715 (closed defect (bug): fixed)
Lost of Priority with Merge_filters and $wp_filters['all']
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | lowest | Milestone: | 2.5 |
| Component: | General | Version: | 2.3 |
| Severity: | trivial | Keywords: | has-patch merge_filters filters plugin.php confirmed |
| Cc: |
Description
I have asked why the merge_filters has array_merge for both $wp_filters['all'] and $wp_filters[$tag], when this will lose the priority information. I suppose this doesn't come up since not many plug-ins setup $wp_filters['all'].
I expect the desired result to be appended with priority information intact.
http://wordpress.org/support/topic/129404?replies=1 has more information.
if ( isset($wp_filter['all']) && is_array($wp_filter['all']) )
$wp_filter[$tag] = $wp_filter['all'] + (array) $wp_filter[$tag];
Is the desired result the lost of priority information when $wp_filter['all'] is used?
Question: I'm not going to set the milestone. Am I supposed to set that? Some trac sites don't like that.
Change History
- Summary changed from Possible Lost of Priority with Merge_filters and $wp_filters['all'] to Lost of Priority with Merge_filters and $wp_filters['all']
- Milestone set to 2.4 (future)
- Keywords plugin.php confirmed added; plugin removed
This has been confirmed by unit tests. Using array_merge reconstructs the priority and destroys the relevant information needed for removal.
This is still only applicable if someone uses add_filter('all', 'function');.
comment:3
darkdragon — 4 years ago
- Priority changed from normal to lowest
- Severity changed from normal to trivial
comment:4
darkdragon — 4 years ago
Any clue on whether this will get in? It is a minor bug yes and an extreme edge case, but just want a heads up on if the patch will get in?
comment:6
darkdragon — 4 years ago
- Status changed from new to closed
- Resolution set to fixed
No longer relevant to WordPress 2.4. Closing as fixed, since merge_filters no longer exists or used.

I need to write some tests to confirm that the desired result is as it is and that you can't remove the hook when using $wp_filters['all']