Advertisement
designbymerovingi

enforce-https-for-wp-attachment-urls

Jan 16th, 2017
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.26 KB | None | 0 0
  1. /**
  2.  * Enforce HTTPS for Attachment URLs
  3.  * @version 1.0
  4.  */
  5. function mycred_pro_enforce_https_for_attachments( $url ) {
  6.  
  7.     return str_replace( 'http://', 'https://', $url );
  8.  
  9. }
  10. add_filter( 'wp_get_attachment_url', 'mycred_pro_enforce_https_for_attachments' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement