Skip to content

Instantly share code, notes, and snippets.

@patrickposner
Created June 23, 2022 09:13
Show Gist options
  • Save patrickposner/ed843e88702f2f7554f3d7f7282be920 to your computer and use it in GitHub Desktop.
Save patrickposner/ed843e88702f2f7554f3d7f7282be920 to your computer and use it in GitHub Desktop.
Fire webhook after static export is done.
<?php
add_action('ss_after_cleanup', function(){
// Get options from Simply Static.
$options = get_option( 'simply-static' );
$basic_auth = $options['http_basic_auth_digest'];
// Prepare URL and data.
$url = 'https://test.com';
$data = [];
$response = wp_remote_post( $url, array(
'body' => $data,
'headers' => array(
'Authorization' => 'Basic ' . $basic_auth ),
),
) );
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment