//Code um Anzahl Downloads via Webhook an PageTrust zu senden
get_download_count();
$response = wp_remote_post( 'https://app.pagetrust.net/pixel-webhook/085e73410c2c8d4fe040fc204e8acbe9', array(
'method' => 'POST',
'timeout' => 45,
'redirection' => 5,
'httpversion' => '1.0',
'blocking' => true,
'headers' => array(),
'body' => array( 'downloads' => $downloads ),
'cookies' => array()
) );
if ( is_wp_error( $response ) ) {
$error_message = $response->get_error_message();
echo "Something went wrong: $error_message";
} else {
echo 'Webhook sent successfully!';
}
}
send_download_count( 3208 );
?>