maybe_disable_automattic_widgets

Disables the Automattic widgets plugin, which was merged into core.

Description

maybe_disable_automattic_widgets(); 

Usage

  1. if ( !function_exists( 'maybe_disable_automattic_widgets' ) ) { 
  2. require_once ABSPATH . '/wp-admin/includes/upgrade.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = maybe_disable_automattic_widgets(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/includes/upgrade.php  
  1. function maybe_disable_automattic_widgets() { 
  2. $plugins = __get_option( 'active_plugins' ); 
  3.  
  4. foreach ( (array) $plugins as $plugin ) { 
  5. if ( basename( $plugin ) == 'widgets.php' ) { 
  6. array_splice( $plugins, array_search( $plugin, $plugins ), 1 ); 
  7. update_option( 'active_plugins', $plugins ); 
  8. break;