Auto_Save_Image是wordpress里一个很好的远程保存图片插件,并且可以去除非本站链接,拥有水印,标题检查重复等实用功能,非常强大。
鉴于wordpress本身添加媒体没有水印功能,所以计划引用Auto_Save_Image这里面的水印类,做出本地图片水印功能。
插件代码比较简单,改了几处即可达到目的。
1.两个checkbox 增加属性 checked = true,使插件默认开启。
|
document.getElementById("titlediv").innerHTML = document.getElementById("titlediv").innerHTML + "<p align="right"><input style="width:20px;" type="checkbox" name="Auto_Save_Image" value="1" id="checkbox" <?php echo $_COOKIE["wordpress_Auto_Save_Image"];?> />自动保存远程图片 <input style="width:20px;" type="checkbox" name="Auto_Remove_Link" value="1" id="checkbox" <?php echo $_COOKIE["wordpress_Auto_Remove_Link"];?> />自动去除非本站链接<input type="hidden" name="temp_ID2" id="temp_ID2"></p>"; |
改为
|
document.getElementById("titlediv").innerHTML = document.getElementById("titlediv").innerHTML + "<p align="right"><input style="width:20px;" type="checkbox" name="Auto_Save_Image" checked="true" value="1" id="checkbox" <?php echo $_COOKIE["wordpress_Auto_Save_Image"];?> />自动保存远程图片 <input style="width:20px;" type="checkbox" name="Auto_Remove_Link" checked="true" value="1" id="checkbox" <?php echo $_COOKIE["wordpress_Auto_Remove_Link"];?> />自动去除非本站链接<input type="hidden" name="temp_ID2" id="temp_ID2"></p>"; |
2.过滤图片地址条件由非本站链接图片地址改阅读全文