Make WordPress Core

Changeset 29064


Ignore:
Timestamp:
07/10/2014 03:48:54 PM (10 years ago)
Author:
SergeyBiryukov
Message:

is_active_widget() should skip orphaned widgets.

props Ninos Ego.
fixes #28810.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets.php

    r28527 r29064  
    11431143    if ( is_array($sidebars_widgets) ) {
    11441144        foreach ( $sidebars_widgets as $sidebar => $widgets ) {
    1145             if ( $skip_inactive && 'wp_inactive_widgets' == $sidebar )
     1145            if ( $skip_inactive && ( 'wp_inactive_widgets' === $sidebar || 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) ) {
    11461146                continue;
     1147            }
    11471148
    11481149            if ( is_array($widgets) ) {
     
    14251426
    14261427        foreach ( $_sidebars_widgets as $sidebar => $widgets ) {
    1427             if ( 'wp_inactive_widgets' == $sidebar || 'orphaned_widgets' == substr( $sidebar, 0, 16 ) )
     1428            if ( 'wp_inactive_widgets' === $sidebar || 'orphaned_widgets' === substr( $sidebar, 0, 16 ) ) {
    14281429                continue;
     1430            }
    14291431
    14301432            if ( !in_array( $sidebar, $registered_sidebar_keys ) ) {
Note: See TracChangeset for help on using the changeset viewer.