Created
January 10, 2017 09:11
-
-
Save daltonnyx/de392f945feb38641dbf77981b896e6d to your computer and use it in GitHub Desktop.
Replace http with https in wp attachments
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
//Replace http with https in wp attachments | |
add_action( 'edited_product_cat', 'save_product_cat_banners', 10, 2 ); | |
function have_https_for_media( $url ) { | |
if ( is_ssl() ) | |
$url = str_replace( 'http://', 'https://', $url ); | |
return $url; | |
} | |
add_filter( 'wp_get_attachment_url', 'have_https_for_media' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment