admin管理员组文章数量:1431917
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
1 Answer
Reset to default 0You 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.
本文标签: Can I use wpeditor() to create a second instance of the editor in my post page
版权声明:本文标题:Can I use wp_editor() to create a second instance of the editor in my post page? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744627927a2616368.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论