Make WordPress Core


Ignore:
Timestamp:
05/08/2009 05:17:54 PM (15 years ago)
Author:
azaozz
Message:

Properly unset widget number when saving

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r11204 r11240  
    13281328                // don't delete other instances of the same multi-widget
    13291329                foreach ( $sidebar as $_widget_id ) {
    1330                     if ( isset($wp_registered_widgets[$_widget_id]['params'][0]['number']) )
    1331                         unset($wp_registered_widgets[$_widget_id]['params'][0]['number']);
     1330                    $_widget = $wp_registered_widgets[$_widget_id];
     1331
     1332                    if ( isset($_widget['params']) &&
     1333                        is_array($_widget['params'][0]) &&
     1334                        array_key_exists('number', $_widget['params'][0]) )
     1335                            unset($wp_registered_widgets[$_widget_id]['params'][0]['number']);
    13321336                }
    13331337            }
Note: See TracChangeset for help on using the changeset viewer.