web/wp-admin/includes/bookmark.php
changeset 204 09a1c134465b
parent 194 32102edaa81b
--- a/web/wp-admin/includes/bookmark.php	Wed Dec 19 12:35:13 2012 -0800
+++ b/web/wp-admin/includes/bookmark.php	Wed Dec 19 17:46:52 2012 -0800
@@ -266,3 +266,25 @@
 
 	return wp_insert_link( $linkdata );
 }
+
+/**
+ * @since 3.5.0
+ * @access private
+ */
+function wp_link_manager_disabled_message() {
+	global $pagenow;
+	if ( 'link-manager.php' != $pagenow && 'link-add.php' != $pagenow && 'link.php' != $pagenow )
+		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 && current_user_can( 'install_plugins' ) ) {
+		$link = network_admin_url( 'plugin-install.php?tab=search&s=Link+Manager' );
+		wp_die( sprintf( __( 'If you are looking to use the link manager, please install the <a href="%s">Link Manager</a> plugin.' ), $link ) );
+	}
+
+	wp_die( __( 'You do not have sufficient permissions to edit the links for this site.' ) );
+}
+add_action( 'admin_page_access_denied', 'wp_link_manager_disabled_message' );