Ticket #22569: 22569.diff
| File 22569.diff, 3.8 KB (added by nacin, 7 months ago) |
|---|
-
wp-admin/link-add.php
9 9 /** Load WordPress Administration Bootstrap */ 10 10 require_once('./admin.php'); 11 11 12 if ( ! current_user_can('manage_links') ) 13 wp_die(__('You do not have sufficient permissions to add links to this site.')); 12 add_filter( 'pre_option_link_manager_enabled', '__return_true', 100 ); 13 $really_can_manage_links = current_user_can( 'manage_links' ); 14 remove_filter( 'pre_option_link_manager_enabled', '__return_true', 100 ); 14 15 16 if ( ! current_user_can( 'manage_links' ) ) { 17 if ( $really_can_manage_links ) { 18 if ( current_user_can( 'install_plugins' ) ) 19 $link = network_admin_url( 'http://localhost/beta/wp-admin/plugin-install.php?tab=search&s=Link+Manager' ); 20 else 21 $link = 'http://wordpress.org/extend/plugins/link-manager/'; 22 23 wp_die( sprintf( __( 'If you are looking to use the link manager, please install the <a href="%s">Link Manager</a> plugin.' ), $link ) ); 24 } 25 26 wp_die( __( 'You do not have sufficient permissions to add links to this site.' ) ); 27 } 28 15 29 $title = __('Add New Link'); 16 30 $parent_file = 'link-manager.php'; 17 31 -
wp-admin/link-manager.php
8 8 9 9 /** Load WordPress Administration Bootstrap */ 10 10 require_once ('admin.php'); 11 if ( ! current_user_can( 'manage_links' ) ) 11 12 add_filter( 'pre_option_link_manager_enabled', '__return_true', 100 ); 13 $really_can_manage_links = current_user_can( 'manage_links' ); 14 remove_filter( 'pre_option_link_manager_enabled', '__return_true', 100 ); 15 16 if ( ! current_user_can( 'manage_links' ) ) { 17 if ( $really_can_manage_links ) { 18 if ( current_user_can( 'install_plugins' ) ) 19 $link = network_admin_url( 'http://localhost/beta/wp-admin/plugin-install.php?tab=search&s=Link+Manager' ); 20 else 21 $link = 'http://wordpress.org/extend/plugins/link-manager/'; 22 23 wp_die( sprintf( __( 'If you are looking to use the link manager, please install the <a href="%s">Link Manager</a> plugin.' ), $link ) ); 24 } 25 12 26 wp_die( __( 'You do not have sufficient permissions to edit the links for this site.' ) ); 27 } 13 28 14 29 $wp_list_table = _get_list_table('WP_Links_List_Table'); 15 30 -
wp-admin/link.php
12 12 /** Load WordPress Administration Bootstrap */ 13 13 require_once ('admin.php'); 14 14 15 add_filter( 'pre_option_link_manager_enabled', '__return_true', 100 ); 16 $really_can_manage_links = current_user_can( 'manage_links' ); 17 remove_filter( 'pre_option_link_manager_enabled', '__return_true', 100 ); 18 19 if ( ! current_user_can( 'manage_links' ) ) { 20 if ( $really_can_manage_links ) { 21 if ( current_user_can( 'install_plugins' ) ) 22 $link = network_admin_url( 'http://localhost/beta/wp-admin/plugin-install.php?tab=search&s=Link+Manager' ); 23 else 24 $link = 'http://wordpress.org/extend/plugins/link-manager/'; 25 26 wp_die( sprintf( __( 'If you are looking to use the link manager, please install the <a href="%s">Link Manager</a> plugin.' ), $link ) ); 27 } 28 29 wp_die( __( 'You do not have sufficient permissions to edit the links for this site.' ) ); 30 } 31 15 32 wp_reset_vars(array('action', 'cat_id', 'linkurl', 'name', 'image', 'description', 'visible', 'target', 'category', 'link_id', 'submit', 'order_by', 'links_show_cat_id', 'rating', 'rel', 'notes', 'linkcheck[]')); 16 33 17 if ( ! current_user_can('manage_links') )18 wp_die( __('You do not have sufficient permissions to edit the links for this site.') );19 20 34 if ( !empty($_POST['deletebookmarks']) ) 21 35 $action = 'deletebookmarks'; 22 36 if ( !empty($_POST['move']) )