14
Aug
Display wordpress editor in any plugin/custom page on admin side
- Category:
- Wordpress

Posted On : August 14, 2013
| No Comment
Many times it is required to add an extra editor on admin side in wordpress. So, for that different plugins are also available like : “Types – Custom Fields and Custom Post Types Management” Plugin or “tinyMCE” Plugin.
But, displaying and editor is also possible using a simple code.
Add below code where want to display wordpress editor
View Code PHP
1 | wp_editor($content,'myeditor'); |
Here,
“$content” is global variable, use as it is and “‘myeditor’” is the id attribute value for textarea(this need to be in lowercase letters, no underscores, no hyphens allowed in id)
Also, if want to give css class to editor, than use below code,
View Code PHP
1 2 | $settings = array(‘editor_css' => ‘classname’); wp_editor( $content, ‘myeditor’, $settings ); |
Here,
in “$setting” array you can specify what extra you want to do in editor, like
Remove media-button from editor then,
View Code PHP
1 | $settings = array( 'media_buttons' => false ); |
Screenshot :
- Tags: