swte

Untitled

Jan 27th, 2023
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. <?php
  2. /**
  3.  * Plugin Name: HTTP Auth for prebuild
  4.  */
  5.  
  6. add_filter('swift3_cache_hit_function', function(){
  7.             $user = ''; // HTTP Auth Username
  8.             $password = '' // HTTP Auth password
  9.             return wp_remote_post($url, array(
  10.                   'timeout'   => 30,
  11.                   'sslverify' => false,
  12.                   'user-agent' => Swift3_Helper::ua_string('cache-hit'),
  13.                   'headers' => array('X-PREBUILD' => 1, 'Authorization' => 'Basic ' . base64_encode( $user . ':' . $password)
  14.             ));
  15. });
Add Comment
Please, Sign In to add comment