WC_Admin_Status::remove_log │ public static │ WC 1.0

Remove/delete the chosen file.

Метод класса: WC_Admin_Status{}

Хуков нет.

Возвращает

null. Ничего (null).

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

$result = WC_Admin_Status::remove_log();

Код WC_Admin_Status::remove_log() WC 11.3.0

public static function remove_log() {
	if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( wp_unslash( $_REQUEST['_wpnonce'] ), 'remove_log' ) ) { // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Tools are allowlisted and nonce-protected; log handles are sanitized and confined.
		wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) );
	}

	if ( ! empty( $_REQUEST['handle'] ) ) {
		$log_handler = new WC_Log_Handler_File();
		$log_handler->remove( wp_unslash( $_REQUEST['handle'] ) ); // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- Tools are allowlisted and nonce-protected; log handles are sanitized and confined.
	}

	wp_safe_redirect( esc_url_raw( admin_url( 'admin.php?page=wc-status&tab=logs' ) ) );
	exit();
}