Skip to content

Instantly share code, notes, and snippets.

@patrickposner
Created March 9, 2022 10:33
Show Gist options
  • Save patrickposner/b6b0060e9798fed9c35dfd6cd1b8ee16 to your computer and use it in GitHub Desktop.
Save patrickposner/b6b0060e9798fed9c35dfd6cd1b8ee16 to your computer and use it in GitHub Desktop.
Simply Static - GitHub send Webhook with Authentication
<?php
add_filter( 'ssp_webhook_args', function( $args ) {
// Get access token.
$options = get_option( 'simply-static' );
$acccess_token = $options['github-personal-access-token'];
// Modify arguments for POST request.
$args = array(
'headers' => array(
'Authorization' => 'token ' . $access_token,
'Accept' => 'application/json',
),
);
return $args;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment