Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Current Example:
- ===============
- echo '<textarea name="'.$field['id'].'" id="'.$field['id'].'">'.$meta.'</textarea>';
- Replaced with the wp_editor:
- ===========================
- $wp_editor_settings = array(
- 'wpautop' => false,
- 'media_buttons' => false,
- 'textarea_name' => $field['id'],
- 'textarea_rows' => 10,
- 'teeny' => true,
- 'tinymce' => array(
- 'content_css' => plugins_url('/css/editor-styles.css', __FILE__),
- 'theme_advanced_buttons1' => 'bold,italic,underline,|,' .
- 'bullist,numlist,blockquote,|,justifyleft,justifycenter' .
- ',justifyright,justifyfull,|,link,unlink' )
- );
- wp_editor( $meta, $field['id'], $wp_editor_settings );
- /* $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()
- */
- Links:
- =====
- http://codex.wordpress.org/Function_Reference/wp_editor - Function Reference/wp editor
- http://codex.wordpress.org/TinyMCE - TinyMCE Codex
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement