2016-04-15 81 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

我認爲你需要在你的esttings定義 'textarea_name' 字段 波紋管所需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() 
); 
相關問題