WordPress.org

Make WordPress Core

Changeset 5344


Ignore:
Timestamp:
04/29/2007 08:53:29 PM (11 years ago)
Author:
rob1n
Message:

Automattically deactivate Automattic Widgets, if activated. see #4169

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2/wp-admin/upgrade-functions.php

    r5093 r5344  
    176176        upgrade_130();
    177177    }
     178   
     179    maybe_disable_automattic_widgets();
    178180
    179181    if ( $wp_current_db_version < 3308 )
     
    11001102}
    11011103
     1104function maybe_disable_automattic_widgets() {
     1105    $plugins = __get_option( 'active_plugins' );
     1106   
     1107    if ( in_array( 'widgets/widgets.php', $plugins ) ) {
     1108        array_splice( $plugins, array_search( 'widgets/widgets.php', $plugins ), 1 );
     1109        update_option( 'active_plugins', $plugins );
     1110    }
     1111}
     1112
    11021113?>
  • trunk/wp-admin/upgrade-functions.php

    r5303 r5344  
    189189        upgrade_230();
    190190    }
     191   
     192    maybe_disable_automattic_widgets();
    191193
    192194    $wp_rewrite->flush_rules();
     
    11121114}
    11131115
     1116function maybe_disable_automattic_widgets() {
     1117    $plugins = __get_option( 'active_plugins' );
     1118   
     1119    if ( in_array( 'widgets/widgets.php', $plugins ) ) {
     1120        array_splice( $plugins, array_search( 'widgets/widgets.php', $plugins ), 1 );
     1121        update_option( 'active_plugins', $plugins );
     1122    }
     1123}
     1124
    11141125?>
Note: See TracChangeset for help on using the changeset viewer.