黄聪

论SEO对人类的重要性,请看我的博客:hcsem.com

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

WordPress 3.5 新增了一对非常有用的挂钩,可以快速在WordPress后台文章编辑器的上方或下方添加提示内容,下面是一个简单的例子,直接将代码添加到主题的 functions.php 文件:

  1. function below_the_title() {
  2.     echo '<h3>在编辑器上方添加的提示内容</h3>';
  3. }
  4.  
  5. add_action( 'edit_form_after_title', 'below_the_title' );
  6.  
  7. function below_the_editor() {
  8.     echo '<h4>在编辑器下方添加的提示内容</h4>';
  9. }
  10.  
  11. add_action( 'edit_form_after_editor', 'below_the_editor' );

结果如下图所示:

add-a-message-above-or-below-the-post-editor-wpdaxue_com

参考资料:http://www.doitwithwp.com/add-a-message-above-or-below-the-post-editor/

posted on 2015-06-04 10:39  黄聪  阅读(520)  评论(0编辑  收藏  举报