Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_action('admin_menu', 'wp_editor_test_menu');
- function wp_editor_test_menu() {
- add_menu_page('wp_editor', 'wp_editor', 'read', 'wp_editor', 'wp_editor_test_page');
- }
- function wp_editor_test_page() {
- echo '<div class="wrap"><h2>wp_editor()</h2>';
- $content = '';
- $id = 'editor-test';
- $settings = array(
- 'quicktags' => array(
- 'buttons' => 'em,strong,link',
- ),
- 'quicktags' => true,
- 'tinymce' => true
- );
- wp_editor($content, $id, $settings);
- echo '</div>';
- }
- /* $settings:
- '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 (needs specific css)
- '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()
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement