2016-04-15 2 views
1

Я пытаюсь встроить редактор Wp на переднем конце, но он не работает после обновления WordPress 4.5, последняя версия,WP редактор не работает на переднем конце в WordPress

$settings = array(
    'wpautop' => true, 
    'postContent' => 'content', 
    'media_buttons' => false, 
    'tinymce' => array(
    'theme_advanced_buttons1' => 'bold,italic,underline,blockquote,separator,strikethrough,bullist,numlist,justifyleft,justifycenter,justifyright,undo,redo,link,unlink,fullscreen', 

    'theme_advanced_buttons2' => 'pastetext,pasteword,removeformat,|,charmap,|,outdent,indent,|,undo,redo', 

    'theme_advanced_buttons3' => '', 

    'theme_advanced_buttons4' => '' 
    ), 

    'quicktags' => array(
     'buttons' => 'b,i,ul,ol,li,link,close' 
    ) 
); 
wp_editor($postContent, 'postContent', $settings); 

Выход отмечая.

+0

Вы включили флаг 'WP_DEBUG' в значение' true', чтобы проверить ошибку? – Milap

+0

@Milap Спасибо за комментарий, Да уже сделано, но ошибки не было. –

+0

Ошибка javascript? проверьте консоль js. –

ответ

0

Я начал билет ошибки в WordPress.org по адресу: https://core.trac.wordpress.org/ticket/36802

Пожалуйста, добавьте любую дополнительную информацию вы можете иметь к этому билету.

0

Я думаю, вам нужно определить поле 'textarea_name' в ваших esttings ниже всех параметров, необходимых для функции wp_editor wp_editor ($ содержание, $ editor_id настройки $ = массив());

// default settings 
$settings = array(
'wpautop' => true, // use wpautop? 
'media_buttons' => true, // show insert/upload button(s) 
'textarea_name' => $editor_id, // set the textarea name to something different, square brackets [] can be used here 
'textarea_rows' => get_option('default_post_edit_rows', 10), // rows="..." 
'tabindex' => '', 
'editor_css' => '', // intended for extra styles for both visual and HTML editors buttons, needs to include the <style> tags, can use "scoped". 
'editor_class' => '', // add extra class(es) to the editor textarea 
'teeny' => false, // output the minimal editor config used in Press This 
'dfw' => false, // replace the default fullscreen with DFW (supported on the front-end in WordPress 3.4) 
'tinymce' => true, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array() 
'quicktags' => true // load Quicktags, can be used to pass settings directly to Quicktags using an array() 
); 
Смежные вопросы