Ticket #25494: 25494.3.diff
File 25494.3.diff, 1.5 KB (added by , 11 years ago) |
---|
-
src/wp-admin/includes/bookmark.php
70 70 } 71 71 72 72 /** 73 * Delete link specified from database 73 * Delete link specified from database. 74 74 * 75 75 * @since 2.0.0 76 76 * … … 79 79 */ 80 80 function wp_delete_link( $link_id ) { 81 81 global $wpdb; 82 82 /** 83 * Fires before a link is deleted. 84 * 85 * @since 2.0.0 86 * 87 * @param int $link_id ID of the link to delete. 88 */ 83 89 do_action( 'delete_link', $link_id ); 84 90 85 91 wp_delete_object_term_relationships( $link_id, 'link_category' ); 86 92 87 93 $wpdb->delete( $wpdb->links, array( 'link_id' => $link_id ) ); 88 94 /** 95 * Fires after a link has been deleted. 96 * 97 * @since 2.2.0 98 * 99 * @param int $link_id ID of the deleted link. 100 */ 89 101 do_action( 'deleted_link', $link_id ); 90 102 91 103 clean_bookmark_cache( $link_id ); … … 206 218 207 219 wp_set_link_cats( $link_id, $link_category ); 208 220 209 if ( $update ) 221 if ( $update ) { 222 /** 223 * Fires after a link was updated in the database. 224 * 225 * @since 2.0.0 226 * 227 * @param int $link_id ID of the link that was updated. 228 */ 210 229 do_action( 'edit_link', $link_id ); 211 else 230 } else { 231 /** 232 * Fires after a link was added to the database. 233 * 234 * @since 2.0.0 235 * 236 * @param int $link_id ID of the link that was added. 237 */ 212 238 do_action( 'add_link', $link_id ); 213 239 } 214 240 clean_bookmark_cache( $link_id ); 215 241 216 242 return $link_id;