Я использовал wordpress 3.8, и я создал плагин, и я отобразил wp_editor.Wordpress wp_editor() не работает
, но это выглядит так.
это мой код.
$content = "";
$edit_id = "slider_text_editor";
wp_editor($content, $edit_id);
Я использовал wordpress 3.8, и я создал плагин, и я отобразил wp_editor.Wordpress wp_editor() не работает
, но это выглядит так.
это мой код.
$content = "";
$edit_id = "slider_text_editor";
wp_editor($content, $edit_id);
попробовать с кодом ниже:
wp_tiny_mce(false, $mce_config);
Где $ mce_config должен быть массивом пар ключ => значение, которые представляют параметры конфигурационные для (TinyMCE) экземпляра редактора.
Настройки конфигурации можно найти здесь.
http://wiki.moxiecode.com/index.php/TinyMCE:Configuration
Или, если вы предпочитаете, краткая рецензию покрытие ключевых точек также можно найти здесь.
http://www.keighl.com/2010/01/tinymce-in-wordpress-plugins/
Если у вас есть проблемы, реализующие код, дайте мне знать, я использовал его в страницу плагинов сам без сучка ..;)
для получения дополнительной информации посетите: How to use Wordpress Text Editor in a custom plugin
благодаря
правильно использовать wp_editor использовать его как это:
// add the admin settings and such
add_action('admin_init', 'wp_your_plugin_admin_init');
function wp_your_plugin_admin_init(){
register_setting('wp_your_plugin_settings', 'wp_your_plugin_settings', 'wp_your_plugin_settings_validate');
add_settings_field('wp_your_plugin_user_custom_text', __('Enter your message','wp_your_plugin'), 'wp_your_plugin_user_custom_text', 'wp_your_plugin', 'wp_your_plugin_main');
function wp_your_plugin_user_custom_text() {
$options = get_option('wp_your_plugin_settings');
$settings = array('media_buttons' => true,'textarea_rows' => 5,'textarea_name' => 'user_custom_text');
wp_editor($options['user_custom_text'],'user_custom_text', $settings );}
// validate
function wp_your_plugin_settings_validate() {
$options = get_option('wp_your_plugin_settings');
if (empty($_POST['user_custom_text'])){
$options['user_custom_text'] = __('Enter your own content, it will be below the original message','wp_your_plugin');// as set when the plugin activated
}else{
$options['user_custom_text'] = wp_kses_post($_POST['user_custom_text']) ;}// u need to Sanitize to be able to get the media to work