WordPress文件及后台编辑器修改

林继 WordPress 2,591 共写了97个字 (2010-08-25 21:38:53) 没有评论 打印 扫描二维码 百度已收录
  1. $notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
  2. //把 wp-includes/pluggable.php 的如上修改成如下,这样如果收到邮件说是博客上面有新留言
  3. //链接就会变成可以直接到留言那一层的锚链接咯
  4. $notify_message .= get_permalink($comment->comment_post_ID) . "#comment-$comment_id\r\n\

出处:来自网络

  1. if ( !$drafts ) {
  2. 	$drafts_query = new WP_Query( array(
  3. 		'post_type' => 'post',
  4. 		'post_status' => 'draft',
  5. 		'author' => $GLOBALS['current_user']->ID,
  6. 		'posts_per_page' => 5, //这里修改成 20,这样一次就能显示更多的草稿咯
  7. 		'orderby' => 'modified',
  8. 		'order' => 'DESC'
  9. 	) );
  10. 	$drafts =& $drafts_query->posts;
  11. }
  12. // 文件于 /wp-admin/includes/dashboard.php

  1. edButtons[edButtons.length]=new edButton("ed_img","img","","","m",-1);
  2. //老样子,先删除这个原本的 img 标签,因为小邪不喜欢这个 ╮( ̄▽ ̄)╭
  3.  
  4. edButtons[edButtons.length]=new edButton("ed_pre_php","pre_php","
  5. <p0re lang='php' line='1'>\n","\n</p0re>","p",-1);
  6. edButtons[edButtons.length]=new edButton("ed_pre_css","pre_css","
  7. <p0re lang='css' line='1'>\n","\n</p0re>","pp",-1);
  8. edButtons[edButtons.length]=new edButton("ed_pre_js","pre_js","
  9. <p0re lang='JavaScript' line='1'>\n","\n</p0re>","ppp",-1);
  10. //然后增加 WP-Syntax 的代码插入按键
  11. edButtons[edButtons.length]=new edButton("ed_oimg","oimg","<img src='"
  12. ,"' />","pppp",-1);
  13. //以及小邪喜欢的 img 标签
  14.  
  15. j.Buttons[j.Buttons.length]=new edButton(a+"_img","img","","","m",-1);
  16. //删除这一行,原因和上面一样,这里是不选中字符时候执行的
  17. j.Buttons[j.Buttons.length]=new edButton(a+"_pre_php","pre_php",
  18. "<p0re lang='php' line='1'>\n","\n</p0re>","p",-1);
  19. j.Buttons[j.Buttons.length]=new edButton(a+"_pre_css","pre_css",
  20. "<p0re lang='css' line='1'>\n","\n</p0re>","pp",-1);
  21. j.Buttons[j.Buttons.length]=new edButton(a+"_pre_js","pre_js",
  22. "<p0re lang='JavaScript' line='1'>\n","\n</p0re>","ppp",-1);
  23. //Syntax 插件的代码插入按键
  24. j.Buttons[j.Buttons.length]=new edButton(a+"_oimg","oimg",
  25. "<img src='","' />","pppp",-1);
  26. //小邪喜欢的 img 标签
  27.  
  28. edButtons[edButtons.length]=new edButton("ed_link","link","","</a>","a");
  29. //删除这行,原本的 link 真难用
  30. edButtons[edButtons.length]=new edButton("ed_olink","olink",
  31. "<a target='_blank' rel='nofollow' href='","'></a>","ppppp",-1);
  32. //增加这行,依然是选中字符后在两边添加所需代码变为 a 标签,在新窗口打开
  33.  
  34. j.Buttons[j.Buttons.length]=new edButton(a+"_link","link","","</a>","a");
  35. //删除这行,代码是不选中字符时候运行的
  36. j.Buttons[j.Buttons.length]=new edButton(a+"_olink","olink",
  37. "<a target='_blank' rel='nofollow' href='","'></a>","ppppp",-1);
  38. //增加这行,老样子
  39.  
  40. j.Buttons[j.Buttons.length]=new edButton(a+"_code","code","<code>",
  41. "</code>","c");
  42. edButtons[edButtons.length]=new edButton("ed_code","code","<code>",
  43. "</code>","c");
  44. //分别删除以上两行,这个按键太占位子鸟
  45.  
  46. //文件于 /wp-includes/js/quicktags.js,注意喔,别忘记将代码中的 p0re 全部替换为 pre
  47. //因为为了显示这些代码已经用了 pre 标签鸟,所以里面的就不能是 pre 了

如果觉得我的文章对您有用,请随意赞赏。您的支持将鼓励我继续创作!

发表评论

电子邮件地址不会被公开。 必填项已用*标注

< >