wp_delete_link( int $link_id )

Deletes a specified link from the database.


Description Description


Parameters Parameters

$link_id

(int) (Required) ID of the link to delete


Top ↑

Return Return

(true) Always true.


Top ↑

Source Source

File: wp-admin/includes/bookmark.php

90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
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 ) );
 
    /**
     * 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 );
 
    return true;
}

Top ↑

Changelog Changelog

Changelog
Version Description
2.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.