Use HTML editor in WordPress theme options

丶灬走出姿态 提交于 2019-12-11 18:06:49

问题


I have a <textarea> in my wp theme settings. How can I convert this to use the wordpress HTML editor instead?


回答1:


Use wp_editor().

Example:

$editor_settings =  array (
    'textarea_rows' => 8
,   'media_buttons' => FALSE
,   'teeny'         => TRUE
,   'tinymce'       => FALSE
    // a very minimal setup
,   'quicktags'     => array ( 'buttons' => 'strong,em,link' )
);
wp_editor( $content, $key, $editor_settings );

For a better example see this answer and the tag wp-editor on WordPress Stack Exchange.



来源:https://stackoverflow.com/questions/10049856/use-html-editor-in-wordpress-theme-options

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!