Ticket #4715 (closed defect (bug): fixed)

Opened 5 years ago

Last modified 4 years ago

Lost of Priority with Merge_filters and $wp_filters['all']

Reported by: darkdragon Owned by: anonymous
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)

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']

  • 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');.

  • Priority changed from normal to lowest
  • Severity changed from normal to trivial

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:5   ryan4 years ago

see #5231

  • 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.

Note: See TracTickets for help on using tickets.