maybe_disable_link_manager

Disables the Link Manager on upgrade if, at the time of upgrade, no links exist in the DB.

Description

maybe_disable_link_manager(); 

Usage

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

Defined (1)

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

/wp-admin/includes/upgrade.php  
  1. function maybe_disable_link_manager() { 
  2. global $wp_current_db_version, $wpdb; 
  3.  
  4. if ( $wp_current_db_version >= 22006 && get_option( 'link_manager_enabled' ) && ! $wpdb->get_var( "SELECT link_id FROM $wpdb->links LIMIT 1" ) ) 
  5. update_option( 'link_manager_enabled', 0 );