]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-admin/includes/bookmark.php
Wordpress 3.7
[autoinstalls/wordpress.git] / wp-admin / includes / bookmark.php
index 0897fdc5a42230a728091bfbaa73c0b15d32cd5d..33785964183d5068ab970e3d75cd1a333f808073 100644 (file)
@@ -70,7 +70,7 @@ function get_default_link_to_edit() {
 }
 
 /**
 }
 
 /**
- * Delete link specified from database
+ * Delete link specified from database.
  *
  * @since 2.0.0
  *
  *
  * @since 2.0.0
  *
@@ -79,13 +79,25 @@ function get_default_link_to_edit() {
  */
 function wp_delete_link( $link_id ) {
        global $wpdb;
  */
 function wp_delete_link( $link_id ) {
        global $wpdb;
-
+       /**
+        * Fires before a link is deleted.
+        *
+        * @since 2.0.0
+        *
+        * @param int $link_id ID of the link to delete.
+        */
        do_action( 'delete_link', $link_id );
 
        wp_delete_object_term_relationships( $link_id, 'link_category' );
 
        $wpdb->delete( $wpdb->links, array( 'link_id' => $link_id ) );
        do_action( 'delete_link', $link_id );
 
        wp_delete_object_term_relationships( $link_id, 'link_category' );
 
        $wpdb->delete( $wpdb->links, array( 'link_id' => $link_id ) );
-
+       /**
+        * Fires after a link has been deleted.
+        *
+        * @since 2.2.0
+        *
+        * @param int $link_id ID of the deleted link.
+        */
        do_action( 'deleted_link', $link_id );
 
        clean_bookmark_cache( $link_id );
        do_action( 'deleted_link', $link_id );
 
        clean_bookmark_cache( $link_id );
@@ -206,11 +218,25 @@ function wp_insert_link( $linkdata, $wp_error = false ) {
 
        wp_set_link_cats( $link_id, $link_category );
 
 
        wp_set_link_cats( $link_id, $link_category );
 
-       if ( $update )
+       if ( $update ) {
+               /**
+                * Fires after a link was updated in the database.
+                *
+                * @since 2.0.0
+                *
+                * @param int $link_id ID of the link that was updated.
+                */
                do_action( 'edit_link', $link_id );
                do_action( 'edit_link', $link_id );
-       else
+       } else {
+               /**
+                * Fires after a link was added to the database.
+                *
+                * @since 2.0.0
+                *
+                * @param int $link_id ID of the link that was added.
+                */
                do_action( 'add_link', $link_id );
                do_action( 'add_link', $link_id );
-
+       }
        clean_bookmark_cache( $link_id );
 
        return $link_id;
        clean_bookmark_cache( $link_id );
 
        return $link_id;