最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Can I use wp_editor() to create a second instance of the editor in my post page?

programmeradmin2浏览0评论

Looking at the codex and the code they provide, it doesn't seem like I can add a second editor. This looks like something more for front-end use rather than for use in the admin.

If I am wrong, can someone help me figure this out?

Thanks.

Looking at the codex and the code they provide, it doesn't seem like I can add a second editor. This looks like something more for front-end use rather than for use in the admin.

If I am wrong, can someone help me figure this out?

Thanks.

Share Improve this question asked Jun 16, 2014 at 4:05 KapitolKapitol 691 gold badge2 silver badges8 bronze badges 2
  • Are you referring to post add/edit page on admin end? Please explain little bit more for exactly what you are trying to achieve. – Chittaranjan Commented Jun 16, 2014 at 7:05
  • Inside a post page having a second content(); area other than the excerpt or custom fields(which seem to get ignored by clients, they always want formatting options in a large textarea box). – Kapitol Commented Jun 20, 2014 at 19:56
Add a comment  | 

1 Answer 1

Reset to default 0

You can always use wp_editor on the admin end. One such situation may be by using metabox. In this case let's say you want to manage custom description about the post. So instead of a simple textarea, you can use wp_editor.

Ex:

In the example given in the above add_meta_box Codex url, you can replace

echo '<input type="text" id="myplugin_new_field" name="myplugin_new_field" value="' . esc_attr( $value ) . '" size="25" />';

by

echo wp_editor( esc_attr( $value ), 'myplugin_new_field' );

You can try out the above code by adding into active theme's functions.php file. Once you do this, you should see an editor now.

发布评论

评论列表(0)

  1. 暂无评论