0x00 参考资料
0x01 方法
1.找到 header.php
找到 WordPress 当前主题文件夹内的 header.php
路径:/wwwroot/wp-content/themes/#主题名称#/header.php
2.添加以下代码
<script ="text/javascript">
function addLink() {
var selection = window.getSelection();
pagelink = ". 原文出自[XXX] 转载请保留原文链接: " + document.location.href;
copytext = selection + pagelink;
newdiv = document.createElement('div');
newdiv.style.position = 'absolute';
newdiv.style.left = '-99999px';
document.body.appendChild(newdiv);
newdiv.innerHTML = copytext;
selection.selectAllChildren(newdiv);
window.setTimeout(function () {
document.body.removeChild(newdiv);
}, 100);
}
document.oncopy = addLink;
</script>