wp_delete_link
函数
wp_delete_link ( $link_id )
- 参数
-
-
(int)
$link_id
ID of the link to delete- Required: 是
-
(int)
- 返回值
-
- (true) Always true.
- 定义位置
-
-
wp-admin/includes/bookmark.php
, line 90
-
wp-admin/includes/bookmark.php
- 引入
- 2.0.0
- 弃用
- –
Deletes a specified link from the database.
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;
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。


