Last active
September 21, 2017 21:57
Revisions
-
kingkool68 revised this gist
Jan 4, 2017 . No changes.There are no files selected for viewing
-
kingkool68 renamed this gist
Jan 4, 2017 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
kingkool68 created this gist
Jan 2, 2017 .There are no files selected for viewing
This file contains 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ /* Here we're filtering the site_url() and get_site_url() functions which are called dozens and dozens of times during a request. In this case we only want to modify $url if the filter was called from a particular PHP class (rtCamp\WP\Nginx\Helper) */ add_filter( 'site_url', function( $url = '' ) { $backtrace = wp_debug_backtrace_summary(); if ( stripos( $backtrace, 'rtCamp\WP\Nginx\Helper' ) ) { $url = str_replace( 'https://', 'http://', $url ); } return $url; });