Using main style.css with add_editor_style

The simplest answer is: you can use whatever stylesheet you want for the editor. editor-style.css is just the default stylesheet loaded if none is passed to add_editor_style(). This will load the specified stylesheet: add_editor_style( ‘some-stylsheet.css’ ); This will load editor-style.css: add_editor_style(); Use whatever better fits your needs. By the way, it is better practice to … Read more

How do I add a listbox to the TinyMCE editor?

In the TinyMCE plugin i wrote, my listbox wraps selected text in HTML, i do that like this.. onselect : function(v) { // Set focus to WordPress editor ed.focus(); // Get selected text var sel_txt = ed.selection.getContent(); // If no text selected if( ” == sel_txt ) return null; var active_style = toggle_styles[v]; if( ‘undefined’ … Read more

Insert shortcode in post editor from javascript (Visual / HTML)

I was pulling my hair out on this one, but I might have figured it out. Try this (with jQuery): if( ! tinyMCE.activeEditor || tinyMCE.activeEditor.isHidden()) { jQuery(‘textarea#content’).val(“[SHORTCODE]test[/SHORTCODE] “); } else { tinyMCE.execCommand(‘mceInsertRawHTML’, false, “[SHORTCODE]test[/SHORTCODE] “); } Basically, you need to set the value of the textarea directly if the editor is hidden.

TinyMCE is broken

Solved it by adding this to wp-config.php, which kills the js combining. define( ‘CONCATENATE_SCRIPTS’, false );

wordpress 3.5 tinymce height

@frabiacca: I’m not sure if you meant the toolbar menu, like Circle B showed or the height of the writing place. If it’s the latter you can : do it easily by gragging the bottom right corner or the textarea or clicking on the fullscreen button of the editor 😀 do it programmatically codex.wordpress.org/TinyMCE function … Read more

Insert text a cursor position in to TinyMCE text editor

To test this, I’ve added a button to one of the other meta boxes on the post edit/new screen, with an id of addtxtbtn. On click, I grabbed the textareas inside the #wp-content-editor-container, which is the default wrapper for the default WP Editor instance. You might need to alter this, if you got different MarkUp. … Read more