Skip to content

Instantly share code, notes, and snippets.

@afragen
Last active July 31, 2020 20:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save afragen/ed00f34f8e03aeedb96bdbf6f3e50495 to your computer and use it in GitHub Desktop.
Save afragen/ed00f34f8e03aeedb96bdbf6f3e50495 to your computer and use it in GitHub Desktop.
Needed for non https local EDD store to correctly run. Set $store_url to your local store URL.
<?php
/**
* Plugin Name: Local EDD Store
* Description: Set `reject_unsafe_urls` to false for $store_url. $store_url will need to be set for the URL of your local EDD store.
* Author: Andy Fragen
* Version: 0.3
* Gist Plugin URI: https://gist.github.com/afragen/ed00f34f8e03aeedb96bdbf6f3e50495
*/
add_filter(
'http_request_args',
function( $r, $url ) {
$store_url = 'eddstore.test';
if ( false !== strpos( $url, $store_url ) ) {
$r['reject_unsafe_urls'] = false;
}
return $r;
},
10,
2
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment