Make WordPress Core

Ticket #19417: 19417.diff

File 19417.diff, 4.5 KB (added by nacin, 13 years ago)
  • wp-includes/plugin.php

     
    251251 * @param string $tag The filter hook to which the function to be removed is hooked.
    252252 * @param callback $function_to_remove The name of the function which should be removed.
    253253 * @param int $priority optional. The priority of the function (default: 10).
    254  * @param int $accepted_args optional. The number of arguments the function accepts (default: 1).
    255254 * @return boolean Whether the function existed before it was removed.
    256255 */
    257 function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = 1) {
     256function remove_filter($tag, $function_to_remove, $priority = 10 ) {
    258257        $function_to_remove = _wp_filter_build_unique_id($tag, $function_to_remove, $priority);
    259258
    260259        $r = isset($GLOBALS['wp_filter'][$tag][$priority][$function_to_remove]);
     
    520519 * @param string $tag The action hook to which the function to be removed is hooked.
    521520 * @param callback $function_to_remove The name of the function which should be removed.
    522521 * @param int $priority optional The priority of the function (default: 10).
    523  * @param int $accepted_args optional. The number of arguments the function accepts (default: 1).
    524522 * @return boolean Whether the function is removed.
    525523 */
    526 function remove_action($tag, $function_to_remove, $priority = 10, $accepted_args = 1) {
    527         return remove_filter($tag, $function_to_remove, $priority, $accepted_args);
     524function remove_action( $tag, $function_to_remove, $priority = 10 ) {
     525        return remove_filter( $tag, $function_to_remove, $priority );
    528526}
    529527
    530528/**
  • wp-includes/taxonomy.php

     
    12051205        }
    12061206
    12071207        // $args can be whatever, only use the args defined in defaults to compute the key
    1208         $filter_key = ( has_filter('list_terms_exclusions') ) ? serialize($GLOBALS['wp_filter']['list_terms_exclusions']) : '';
     1208        $filter_key = false !== has_filter( 'list_terms_exclusions' ) ? serialize($GLOBALS['wp_filter']['list_terms_exclusions']) : '';
    12091209        $key = md5( serialize( compact(array_keys($defaults)) ) . serialize( $taxonomies ) . $filter_key );
    12101210        $last_changed = wp_cache_get('last_changed', 'terms');
    12111211        if ( !$last_changed ) {
  • wp-includes/capabilities.php

     
    10861086
    10871087                $meta_key = isset( $args[ 1 ] ) ? $args[ 1 ] : false;
    10881088
    1089                 if ( $meta_key && has_filter( "auth_post_meta_{$meta_key}" ) ) {
     1089                if ( $meta_key && false !== has_filter( "auth_post_meta_{$meta_key}" ) ) {
    10901090                        $allowed = apply_filters( "auth_post_meta_{$meta_key}", false, $meta_key, $post->ID, $user_id, $cap, $caps );
    10911091                        if ( ! $allowed )
    10921092                                $caps[] = $cap;
  • wp-includes/class-wp.php

     
    402402                }
    403403
    404404                // query_string filter deprecated.  Use request filter instead.
    405                 if ( has_filter('query_string') ) {  // Don't bother filtering and parsing if no plugins are hooked in.
     405                if ( false !== has_filter('query_string') ) {  // Don't bother filtering and parsing if no plugins are hooked in.
    406406                        $this->query_string = apply_filters('query_string', $this->query_string);
    407407                        parse_str($this->query_string, $this->query_vars);
    408408                }
  • wp-admin/includes/class-wp-ms-sites-list-table.php

     
    150150                        'users'       => __( 'Users' )
    151151                );
    152152
    153                 if ( has_filter( 'wpmublogsaction' ) )
     153                if ( false !== has_filter( 'wpmublogsaction' ) )
    154154                        $sites_columns['plugins'] = __( 'Actions' );
    155155
    156156                $sites_columns = apply_filters( 'wpmu_blogs_columns', $sites_columns );
     
    317317                                        break;
    318318
    319319                                case 'plugins': ?>
    320                                         <?php if ( has_filter( 'wpmublogsaction' ) ) {
     320                                        <?php if ( false !== has_filter( 'wpmublogsaction' ) ) {
    321321                                        echo "<td valign='top' class='$column_name column-$column_name'$style>";
    322322                                                do_action( 'wpmublogsaction', $blog['blog_id'] ); ?>
    323323                                        </td>