2017-10-30 7 views
1

を示していますwp_editorは、私は、単純なPHPページ内(ないプラグインではなく、管理セクションで)wp_editorを使用しようとしている何のボタン

define('WP_USE_THEMES', false); 
    require('wp-blog-header.php'); 
    $editor_id = 'mycustomeditor'; 
    wp_editor("My content", $editor_id); 

私はフィールドを持って、ビジュアル/ HTMLボタンが、それです私は他のボタンやツールバーを持っていません。

wp_editorを呼び出す前に他のWPライブラリをロードする必要がありますか?

ありがとうございました!

答えて

0

エディタにもいくつかの設定変数を渡すことができます。それを渡さないと、デフォルト値が使用されます。

フッターをロードする前に私のページのどこにでもexit();を置いておけば、フッタのスクリプトの一部がロードされるのでツールバーのボタンが表示されません。したがって、フッターをロードする前にexit()またはdie()がある場合、ツールバーはロードされません。

ここで私はそれを私の編集者とその正常な作業に渡しました。

define('WP_USE_THEMES', false); 
require('wp-blog-header.php'); 
$editor_id = 'mycustomeditor'; 
$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' => '', // extra styles for both visual and HTML editors buttons, 
    '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() 
); 
wp_editor("My content", $editor_id, $settings); 
関連する問題