wp_ajax_delete_link() - WordPress 函数参考中文文档

返回介绍

wp_ajax_delete_link()

发布于 2017-09-11 字数1336 浏览 831 评论 0

wp_ajax_delete_link()

Ajax handler for deleting a link.


描述


源代码

File: wp-admin/includes/ajax-actions.php

function wp_ajax_delete_link() {
	$id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;

	check_ajax_referer( "delete-bookmark_$id" );
	if ( !current_user_can( 'manage_links' ) )
		wp_die( -1 );

	$link = get_bookmark( $id );
	if ( !$link || is_wp_error( $link ) )
		wp_die( 1 );

	if ( wp_delete_link( $id ) )
		wp_die( 1 );
	else
		wp_die( 0 );
}

更新日志

Version 描述
3.1.0 Introduced.

相关函数

Uses

  • wp-admin/includes/bookmark.php:
    wp_delete_link()
  • wp-includes/capabilities.php:
    current_user_can()
  • wp-includes/pluggable.php:
    check_ajax_referer()
  • wp-includes/functions.php:
    wp_die()
  • wp-includes/bookmark.php:
    get_bookmark()
  • wp-includes/load.php:
    is_wp_error()
  • Show 1 more use
    Hide more uses


User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!