I am using FORCE_SSL_ADMIN
in wp-config.php
so everytime I upload a new image and inserted into the post, it is using SSL version
e.g.
<img src="https://www.example.com/wp-content/uploads/2013/01/test.png" ..
My blog is using HTTP in the public side, so how to make the upload path as rotocol independent, e.g.
<img src="//www.example.com/wp-content/uploads/2013/01/test.png" ..
You can define a function to remove the protocol and hook it to the attachment URL:
Also consider to use relative URLs for attachments by using WordPress builtin function
wp_make_link_relative
:Place this code to your
functions.php
. Not tested though.Update: already tested