Last active
May 27, 2019 17:01
-
-
Save landbryo/a187c595d9390b8a1c7055d1ced61694 to your computer and use it in GitHub Desktop.
Rewrite image URL for local development
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 characters
function sc_rewrite_url( $rewrite ) { | |
$rewrite = str_replace( 'domain.local/wp-content/uploads/', 'domain.com/wp-content/uploads/', $rewrite ); | |
return $rewrite; | |
} | |
add_filter( 'wp_get_attachment_url', 'sc_rewrite_url' ); | |
add_filter( 'wp_calculate_image_srcset_meta', function() { return false; } ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment