Created
January 25, 2018 19:55
-
-
Save cklosowski/64a261bb348c52b17864a65425264ebc to your computer and use it in GitHub Desktop.
Add TLDs and Subdomains to Software Licensing is_local_url checks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Example of adding a TLD (.org in this example) to the is_local_url check. | |
function ck_add_url_tlds( $tlds_to_check ) { | |
$tlds_to_check[] = '.org'; | |
return $tlds_to_check; | |
} | |
add_filter( 'edd_sl_url_tlds', 'ck_add_url_tlds', 10, 1 ); | |
// Example of adding a subdomain (*.stage in this example) to the is_local_url check. | |
function ck_add_url_subdomains( $subdomains_to_check ) { | |
$subdomains_to_check[] = '*.stage'; | |
return $subdomains_to_check; | |
} | |
add_filter( 'edd_sl_url_subdomains', 'ck_add_url_subdomains', 10, 1 ); |
adding them to the tld check seems better, as it uses a more general catch all:
if ( false !== strpos( $host, $tld ) )
I use this:
add_filter( 'edd_sl_url_tlds', 'edd_sl_local_tlds' );
function edd_sl_local_tlds( $tlds ) {
$tlds[] = '.wpengine.com';
$tlds[] = '.myftpupload.com';
return $tlds;
}
Is this something that the site owner needs to do or the hosting company? or the developer of the plugin?
I am using my custom staging urls and I am not able to make this work so far.
Thanks!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To add WP Engine, would I use:
GoDaddy has a more "random" staging site, ie.
z#.#f#.myftpupload.com
So would this work on theedd_sl_url_subdomains
filter?