Make WordPress Core

Ticket #12492: 12492.patch

File 12492.patch, 1.1 KB (added by hakre, 15 years ago)

Some code cleanups added.

  • wordpress/wp-includes/plugin.php

     
    212212/**
    213213 * Remove all of the hooks from a filter.
    214214 *
    215  * @since 2.7
     215 * @since 2.7.0
    216216 *
    217217 * @param string $tag The filter to remove hooks from.
    218218 * @param int $priority The priority number to remove.
    219219 * @return bool True when finished.
    220220 */
    221 function remove_all_filters($tag, $priority = false) {
     221function remove_all_filters( $tag, $priority = false ) {
    222222        global $wp_filter, $merged_filters;
    223223
    224         if( isset($wp_filter[$tag]) ) {
    225                 if( false !== $priority && isset($$wp_filter[$tag][$priority]) )
    226                         unset($wp_filter[$tag][$priority]);
     224        if ( isset( $wp_filter[$tag] ) ) {
     225                if( false !== $priority && isset( $wp_filter[$tag][$priority] ) )
     226                        unset( $wp_filter[$tag][$priority] );
    227227                else
    228                         unset($wp_filter[$tag]);
     228                        unset( $wp_filter[$tag] );
    229229        }
    230230
    231         if( isset($merged_filters[$tag]) )
    232                 unset($merged_filters[$tag]);
     231        if ( isset( $merged_filters[$tag] ) )
     232                unset( $merged_filters[$tag] );
    233233
    234234        return true;
    235235}