maybe_disable_link_manager() WordPress Function

The maybe_disable_link_manager() function is a utility function that allows you to conditionally disable the link manager in WordPress. This can be useful if you want to disable the link manager on a site that doesn't need it, or if you want to disable the link manager on a development site.

maybe_disable_link_manager() #

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


Source

File: wp-admin/includes/upgrade.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 );
	}
}


Top ↑

Changelog

Changelog
VersionDescription
3.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.