Advertisements

wp_delete_link

Definition:
function wp_delete_link( $link_id ) {}

Delete link specified from database

Parameters

  • int $link_id: ID of the link to delete

Return values

returns:True

Defined actions

  • delete_link
    do_action( 'delete_link', $link_id );
  • deleted_link
    do_action( 'deleted_link', $link_id );

Source code

function wp_delete_link( $link_id ) {

	global $wpdb;



	do_action( 'delete_link', $link_id );



	wp_delete_object_term_relationships( $link_id, 'link_category' );



	$wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->links WHERE link_id = %d", $link_id ) );



	do_action( 'deleted_link', $link_id );



	clean_bookmark_cache( $link_id );



	return true;

}

3589

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: