On this page
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. View all references
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 );
}
}
Related
Uses
| Uses | Description |
|---|---|
| update_option() wp-includes/option.php | Updates the value of an option that was already added. |
| get_option() wp-includes/option.php | Retrieves an option value based on an option name. |
| wpdb::get_var() wp-includes/class-wpdb.php | Retrieves one variable from the database. |
Changelog
| Version | Description |
|---|---|
| 3.5.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/maybe_disable_link_manager