Make WordPress Core

Ticket #26704: multiple-actions.patch

File multiple-actions.patch, 664 bytes (added by sigurdbergsvela, 11 years ago)

Patch that implements this feature

  • src/wp-includes/plugin.php

    diff --git src/wp-includes/plugin.php src/wp-includes/plugin.php
    index df4ba8d..151f599 100644
    if ( ! isset( $wp_current_filter ) ) 
    8080 * @return boolean true
    8181 */
    8282function add_filter( $tag, $function_to_add, $priority = 10, $accepted_args = 1 ) {
     83        $tag_a = explode(' ', $tag);
     84        if (isset($tag_a[1])) { //Check if the array is longer than 1 element
     85                foreach ($tag_a as $t) {
     86                        add_filter($t, $function_to_add, $priority, $accepted_args);
     87                }
     88       return;
     89        }
     90       
    8391        global $wp_filter, $merged_filters;
    8492
    8593        $idx = _wp_filter_build_unique_id($tag, $function_to_add, $priority);