Ticket #14960: patch14960.diff
File patch14960.diff, 3.4 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 48 $actions['show'] = __('Show'); 49 $actions['hide'] = __('Hide'); 47 50 $actions['delete'] = __( 'Delete' ); 48 51 49 52 return $actions; … … 137 140 138 141 $actions = array(); 139 142 $actions['edit'] = '<a href="' . $edit_link . '">' . __( 'Edit' ) . '</a>'; 143 $actions['show'] = '<a href="' . wp_nonce_url( "link.php?action=show&link_id=" . $link->link_id, "show_" . $link->link_id ) . '">' . __("Show") . '</a>'; 144 $actions['hide'] = '<a href="' . wp_nonce_url( "link.php?action=hide&link_id=" . $link->link_id, "hide_" . $link->link_id ) . '">' . __("Hide") . '</a>'; 140 145 $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>"; 141 146 echo $this->row_actions( $actions ); 142 147 -
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_' . $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_' . $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'];21 22 $bulklinks = (array) $_REQUEST['linkcheck']; 23 if ( $doaction == 'delete' ) { 24 24 foreach ( $bulklinks as $link_id ) { 25 25 $link_id = (int) $link_id; 26 26 … … 29 29 30 30 wp_redirect( add_query_arg('deleted', count( $bulklinks ), admin_url( 'link-manager.php' ) ) ); 31 31 exit; 32 } elseif ($doaction == 'hide') { 33 foreach($bulklinks as $link_id) { 34 $link_data = (array)get_link_to_edit($link_id); 35 $link_data['link_visible'] = 'N'; 36 wp_update_link($link_data); 37 } 38 } elseif ($doaction == 'show') { 39 foreach($bulklinks as $link_id) { 40 $link_data = (array)get_link_to_edit($link_id); 41 $link_data['link_visible'] = 'Y'; 42 wp_update_link($link_data); 43 } 32 44 } 33 45 } elseif ( ! empty( $_GET['_wp_http_referer'] ) ) { 34 46 wp_redirect( remove_query_arg( array( '_wp_http_referer', '_wpnonce' ), stripslashes( $_SERVER['REQUEST_URI'] ) ) );