WordPress.org

Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#4715 closed defect (bug) (fixed)

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

Reported by: darkdragon 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 @santosj
14 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']

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

#2 @santosj
14 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');.

#3 @darkdragon
14 years ago

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

#4 @darkdragon
14 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?

#6 @darkdragon
14 years ago

  • Resolution set to fixed
  • Status changed from new to closed

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.