How to Add Custom Button to Text(HTML) Editor and NOT Visual Editor
How to Add Custom Button to Text(HTML) Editor and NOT Visual Editor
How to Add Custom Button to Text(HTML) Editor and NOT Visual Editor
Add this to your theme’s functions.php file: add_editor_style(); By default that function will load a file called editor-style.css which is located in the root directory of your theme. The functions accepts a filename or an array of filenames as parameter. Reference in the Codex: http://codex.wordpress.org/Function_Reference/add_editor_style If you want (or need to have) more control over … Read more
tiny_mce_before_init is a filter that gets the whole TinyMCE configuration, but there are filters that act on smaller parts of it, like mce_buttons for only the buttons. The advantage here is that they act on arrays, so it’s easy to add or remove parts from them. This is how Vipers Video Quicktags does it too. … Read more
The reason why this isn’t working is because the WordPress core isn’t loaded when this dynamic style sheet is loaded. get_option() hasn’t been defined yet. What you need to do is load WordPress at the top of your dynamic stylesheet: <?php include(“../../../wp-load.php”); ?>
http://tinymce.moxiecode.com/punbb/viewtopic.php?id=1522 might be what you are looking for. It’s also possible in tinymce to have different levels of editor (minimal, regular, +kitchen sink). Perhaps using one of those may serve your purpose better.
Maybe this tutorial will help you. EDIT: some code in case the original source gets lost. 1st) Add the meta box to all the post types we need function wpse31877_add_custom_meta_boxes() { foreach ( array( ‘post’, ‘page’ ) as $post_type ) { add_meta_box( ‘wp_custom_attachment’ ,’Custom Attachment’ ,’wpse31877_custom_attachment’ ,$post_type ,’side’ ); } } add_action( ‘add_meta_boxes’, ‘wpse31877_add_custom_meta_boxes’ ); … Read more
This error was corrected when I installed the plugin TinyMCE Advanced and activated the option “Stop removing the <p> and <br /> tags when saving …”.
You should use wp_enqueue_script for your javascript files instead of adding the code directly into the post content. ps: You can check out the callbacks on the the_content filter, using add_action(‘wp_footer’,function(){ global $wp_filter; printf(‘<pre>%s</pre>’,print_r( $wp_filter[‘the_content’],true)); }); to display them in the footer part of your theme. Then you will see callbacks like wpautop, wptexturize, convert_chars … Read more
@dalbeab already answered your question, but thought I would point out a way to add horizontal rule to your editor if you wish. Within functions.php, you can add this: // add horizontal rule button function enable_more_buttons($buttons) { $buttons[] = ‘hr’; return $buttons; } add_filter(‘mce_buttons’, ‘enable_more_buttons’); Then you will have a TinyMCE button that looks like … Read more
I Googled wordpress mce filter, and it led me pretty directly to a TinyMCE Custom Styles tutorial on the Codex. It’s not a simple thing — you have to, for starters, enable a hidden button in TinyMCE called styleselect — but it looks like the tutorial is fairly complete. Is that what you’re looking for? … Read more