WordPress at a glance
function is not described

maybe_disable_link_manager() WP 3.5.0

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

No Hooks.

Return

Null. Nothing.

Usage

maybe_disable_link_manager();

Notes

  • Global. Int. $wp_current_db_version
  • Global. wpdb. $wpdb WordPress database abstraction object.

Changelog

Since 3.5.0 Introduced.

Code of maybe disable link manager: wp-admin/includes/upgrade.php WP 5.2.2

<?php
function maybe_disable_link_manager() {
	global $wp_current_db_version, $wpdb;

	if ( $wp_current_db_version >= 22006 && get_option( 'link_manager_enabled' ) && ! $wpdb->get_var( "SELECT link_id FROM $wpdb->links LIMIT 1" ) ) {
		update_option( 'link_manager_enabled', 0 );
	}
}