Make fonts.com font work in TinyMCE (iframe referrer issue)

I ran into this issue with Typekit, here’s my solution: http://www.tomjn.com/150/typekit-wp-editor-styles/ add_filter(“mce_external_plugins”, “tomjn_mce_external_plugins”); function tomjn_mce_external_plugins($plugin_array){ $plugin_array[‘typekit’] = get_template_directory_uri().’/typekit.tinymce.js’; return $plugin_array; } and this js: (function() { tinymce.create(‘tinymce.plugins.typekit’, { init: function(ed, url) { ed.onPreInit.add(function(ed) { // Get the DOM document object for the IFRAME var doc = ed.getDoc(); // Create the script we will add to … Read more

TinyMCE format dropdown no longer showing style previews

Ok, this was driving me nuts too as it seems to be completely undocumented However, fear not for it is surprisingly easy to fix! 😀 In your tiny_mce_before_init hook function right before the return statement simply add the line: unset($init[‘preview_styles’]); This will make wordpress function as it did before the 3.6 update (the updated added … Read more

Unable to add “code” button to TinyMCE toolbar

That is a very good question. I just tested your code locally and see the same result. A little digging reveals a twp-part problem. wp-includes/class-wp-editor.php is a good read for TinyMCE customizations WordPress 3.9 did update to TinyMCE 4.0 and the TinyMCE docs imply that the superscript button is now called “superscript” and not just … Read more

How to replace the content of tinyMCE editor in both text and visual mode using jQuery?

The first thing to do is to select the active editor. Here we select the editor using its id, which is content. var activeEditor = tinyMCE.get(‘content’); Then we use tinyMCE’s setContent: var activeEditor = tinyMCE.get(‘content’); var content=”HTML or plain text content here…”; activeEditor.setContent(content); However, if the editor is in text mode to begin with, after … Read more

Replace Taxomony Description Field with Visual/WYSIWYG Editor

You can use a {$taxonomy}_edit_form_fields action hook to add html to the term edit table. In that HTML you can remove description textarea and add tinymce editor add_action(“{$taxonomy}_edit_form_fields”, ‘add_form_fields_example’, 10, 2); function add_form_fields_example($term, $taxonomy){ ?> <tr valign=”top”> <th scope=”row”>Description</th> <td> <?php wp_editor(html_entity_decode($term->description), ‘description’, array(‘media_buttons’ => false)); ?> <script> jQuery(window).ready(function(){ jQuery(‘label[for=description]’).parent().parent().remove(); }); </script> </td> </tr> <?php … Read more

Reset Undo on the tinymce editor

The global variable tinyMCE has an array of editors. So you have to call the undoManager inside them. Like this for default wp editor on post edit/create screen: tinyMCE.editors[0].undoManager.clear(); If you want to do it in a specific editor, select the editor id in n like this: var n = 0; // editor id tinyMCE.editors[n].undoManager.clear();

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)