Make WordPress Core


Ignore:
Timestamp:
11/26/2011 06:16:43 AM (13 years ago)
Author:
azaozz
Message:

Check the sidebar class for orphaned sidebars, match sidebars by id while retrieving orphans and the theme has not changed, props SergeyBiryukov, fixes #19350

File:
1 edited

Legend:

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

    r19454 r19455  
    9797            register_sidebar(array(
    9898                'name' => __( 'Inactive Sidebar (not used)' ),
    99                 'id' => 'orphaned_widgets-' . $sidebar_id,
     99                'id' => $sidebar_id,
    100100                'class' => 'inactive-sidebar orphan-sidebar',
    101101                'description' => __( 'This sidebar is no longer available and does not show anywhere on your site. Remove each of the widgets below to fully remove this inactive sidebar.' ),
     
    345345<?php
    346346foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
    347     if ( 'wp_inactive_widgets' == $sidebar || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) ) {
     347    if ( false !== strpos( $registered_sidebar['class'], 'inactive-sidebar' ) || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) ) {
    348348        $wrap_class = 'widgets-holder-wrap';
    349349        if ( !empty( $registered_sidebar['class'] ) )
     
    377377$i = 0;
    378378foreach ( $wp_registered_sidebars as $sidebar => $registered_sidebar ) {
    379     if ( 'wp_inactive_widgets' == $sidebar || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) )
     379    if ( false !== strpos( $registered_sidebar['class'], 'inactive-sidebar' ) || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) )
    380380        continue;
    381381
Note: See TracChangeset for help on using the changeset viewer.