global $pagenow;
if ( !
in_array( $pagenow, array
( 'link-manager.php', 'link-add.php', 'link.php'
), true
) ) { return;
} add_filter( 'pre_option_link_manager_enabled', '__return_true', 100
);
$really_can_manage_links =
current_user_can( 'manage_links'
);
remove_filter( 'pre_option_link_manager_enabled', '__return_true', 100
);
if ( $really_can_manage_links ) { $plugins =
get_plugins();
if ( empty( $plugins['link-manager/link-manager.php'
] ) ) { if ( current_user_can( 'install_plugins'
) ) { $install_url =
wp_nonce_url( self_admin_url( 'update.php?action=install-plugin&plugin=link-manager'
),
'install-plugin_link-manager'
);
wp_die( sprintf( /* translators: %s: A link to install the Link Manager plugin. */