Ticket #14960: patch14960_v2.diff
File patch14960_v2.diff, 4.3 KB (added by , 13 years ago) |
---|
-
wp-admin/includes/class-wp-links-list-table.php
44 44 45 45 function get_bulk_actions() { 46 46 $actions = array(); 47 $actions['delete'] = __( 'Delete' ); 47 48 $actions['show'] = _x( 'Show', 'link' ); 49 $actions['hide'] = _x( 'Hide', 'link' ); 50 $actions['delete'] = _x( 'Delete', 'link' ); 48 51 49 52 return $actions; 50 53 } … … 137 140 138 141 $actions = array(); 139 142 $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>'; 140 $actions['delete'] = "<a class='submitdelete' href='" . wp_nonce_url( "link.php?action=delete&link_id=$link->link_id", 'delete-bookmark_' . $link->link_id ) . "' onclick=\"if ( confirm( '" . esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ) . "' ) ) { return true;}return false;\">" . __( 'Delete' ) . "</a>"; 143 if($link->link_visible == 'N') { 144 $actions['show'] = '<a href="' . esc_url(wp_nonce_url( admin_url( 'link.php?action=show&link_id=' . $link->link_id ), 'show-bookmark_' . $link->link_id )) . '">' . __( 'Show' ) . '</a>'; 145 } else if($link->link_visible == 'Y') { 146 $actions['hide'] = '<a href="' . esc_url(wp_nonce_url( admin_url( 'link.php?action=hide&link_id=' . $link->link_id), 'hide-bookmark_' . $link->link_id )) . '">' . __( 'Hide' ) . '</a>'; 147 } 148 $actions['delete'] = "<a class='submitdelete' href='" . esc_url(wp_nonce_url(admin_url( "link.php?action=delete&link_id=$link->link_id"), 'delete-bookmark_' . $link->link_id )) . "' onclick=\"if ( confirm( '" . esc_js( sprintf( __( "You are about to delete this link '%s'\n 'Cancel' to stop, 'OK' to delete." ), $link->link_name ) ) . "' ) ) { return true;}return false;\">" . __( 'Delete' ) . "</a>"; 141 149 echo $this->row_actions( $actions ); 142 150 143 151 echo '</td>'; -
wp-admin/link.php
85 85 exit; 86 86 break; 87 87 88 case 'show' : 89 $link_id = (int) $_GET['link_id']; 90 check_admin_referer('show-bookmark_' . $link_id); 91 92 $link_data = (array)get_link_to_edit($link_id); 93 $link_data['link_visible'] = 'Y'; 94 wp_update_link($link_data); 95 96 wp_redirect($this_file); 97 die(); 98 break; 99 100 case 'hide' : 101 $link_id = (int) $_GET['link_id']; 102 check_admin_referer('hide-bookmark_' . $link_id); 103 104 $link_data = (array)get_link_to_edit($link_id); 105 $link_data['link_visible'] = 'N'; 106 wp_update_link($link_data); 107 108 wp_redirect($this_file); 109 die(); 110 break; 111 88 112 case 'delete' : 89 113 $link_id = (int) $_GET['link_id']; 90 114 check_admin_referer('delete-bookmark_' . $link_id); -
wp-admin/link-manager.php
18 18 19 19 if ( $doaction && isset( $_REQUEST['linkcheck'] ) ) { 20 20 check_admin_referer( 'bulk-bookmarks' ); 21 22 if ( 'delete' == $doaction ) { 23 $bulklinks = (array) $_REQUEST['linkcheck']; 24 foreach ( $bulklinks as $link_id ) { 25 $link_id = (int) $link_id; 26 27 wp_delete_link( $link_id ); 21 22 $bulklinks = (array) $_REQUEST['linkcheck']; 23 switch($doaction) { 24 case 'delete': 25 foreach ( $bulklinks as $link_id ) { 26 $link_id = (int) $link_id; 27 28 wp_delete_link( $link_id ); 29 } 30 31 wp_redirect( add_query_arg('deleted', count( $bulklinks ), admin_url( 'link-manager.php' ) ) ); 32 exit; 33 break; 34 case 'hide': 35 foreach($bulklinks as $link_id) { 36 $link_data = (array)get_link_to_edit($link_id); 37 $link_data['link_visible'] = 'N'; 38 wp_update_link($link_data); 39 } 40 break; 41 case 'show': 42 foreach($bulklinks as $link_id) { 43 $link_data = (array)get_link_to_edit($link_id); 44 $link_data['link_visible'] = 'Y'; 45 wp_update_link($link_data); 46 } 47 break; 28 48 } 29 30 wp_redirect( add_query_arg('deleted', count( $bulklinks ), admin_url( 'link-manager.php' ) ) );31 exit;32 }33 49 } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) { 34 50 wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) ); 35 51 exit;