原型

wp_ajax_delete_page( string $action )

参数

$action (string) (Required)

源文件

路径:wp-admin/includes/ajax-actions.php

<?php
...
function wp_ajax_delete_page( $action ) {
	if ( empty( $action ) )
		$action = 'delete-page';
	$id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
	check_ajax_referer( "{$action}_$id" );
	if ( !current_user_can( 'delete_page', $id ) )
		wp_die( -1 );
	if ( ! get_post( $id ) )
		wp_die( 1 );
	if ( wp_delete_post( $id ) )
		wp_die( 1 );
	else
		wp_die( 0 );
}
...
?>

其他

英文文档:https://developer.wordpress.org/reference/functions/wp_ajax_delete_page/