Opened 18 years ago
Closed 17 years ago
#4715 closed defect (bug) (fixed)
Lost of Priority with Merge_filters and $wp_filters['all']
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 2.5 | Priority: | lowest |
Severity: | trivial | Version: | 2.3 |
Component: | General | Keywords: | has-patch merge_filters filters plugin.php confirmed |
Focuses: | 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 (6)
#1
@
18 years ago
- Milestone set to 2.4 (future)
- 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']
#2
@
18 years ago
- 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');
.
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']