WordPress.org

Make WordPress Core

Ticket #6833: 2008-04-24-wp-admin-index-php.patch

File 2008-04-24-wp-admin-index-php.patch, 678 bytes (added by silas, 6 years ago)

A patch I used to fix this

  • wp-admin/index.php

     
    9898<?php 
    9999$ct = current_theme_info(); 
    100100$sidebars_widgets = wp_get_sidebars_widgets(); 
    101 $num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr', 'return $prev+count($curr);' ) ); 
     101$num_widgets = array_reduce( $sidebars_widgets, create_function( '$prev, $curr', 'return $prev+count($curr);' ), 0 ); 
    102102$widgets_text = sprintf( __ngettext( '%d widget', '%d widgets', $num_widgets ), $num_widgets ); 
    103103if ( $can_switch_themes = current_user_can( 'switch_themes' ) ) 
    104104        $widgets_text = "<a href='widgets.php'>$widgets_text</a>";