WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Самая быстрая Тема-конструктор для WordPress
функция не описана

wpcf7_rest_delete_contact_form() CF7 1.0

Хуков нет.

Возвращает

Null. Ничего.

Использование

wpcf7_rest_delete_contact_form( $request );

Код wpcf7_rest_delete_contact_form() CF7 5.3

<?php
function wpcf7_rest_delete_contact_form( WP_REST_Request $request ) {
	$id = (int) $request->get_param( 'id' );
	$item = wpcf7_contact_form( $id );

	if ( ! $item ) {
		return new WP_Error( 'wpcf7_not_found',
			__( "The requested contact form was not found.", 'contact-form-7' ),
			array( 'status' => 404 )
		);
	}

	$result = $item->delete();

	if ( ! $result ) {
		return new WP_Error( 'wpcf7_cannot_delete',
			__( "There was an error deleting the contact form.", 'contact-form-7' ),
			array( 'status' => 500 )
		);
	}

	$response = array( 'deleted' => true );

	return rest_ensure_response( $response );
}