Markup of oEmbed codes in the editor?

I think this might be a step in the right direction: http://codex.wordpress.org/Plugin_API/Filter_Reference Specifically the the_editor_content filter which is “applied to post content before putting it into a rich editor window.” Sorry I can’t flesh it out more for you but I am just starting to play around with filters myself and have miles to go … Read more

Is it possible to re-use the image details popup?

Let me answer in the most simple way. It depends on the situation and sometimes you might want to create your own MediaFrame, but i think this would be slightly out of the questions scope and would need much more explanation: Assuming all there is is an ID of the attachment to edit, following code … Read more

wp_editor disable after reaching character count limit

I guess the keyup event is too late. If you use the keypress event instead of keyup, then this seems to work: ed.on( ‘keypress’, function(e) { var content = ed.getContent().replace( /(<[a-zA-Z\/][^<>]*>|\[([^\]]+)\])|(\s+)/ig, ” ); var max = 20; var len = content.length; var diff = max – len; if ( diff < 1 ) tinymce.dom.Event.cancel(e); document.getElementById(“character_count”).innerHTML … Read more

WordPress 3.2 has broken my TinyMCE code

I found some info on changes in 3.2 that might be relevant: Aparrently, wp_tiny_mce_preload_dialogs() no longer exists from WP3.2 on. It got replaced by wp_preload_dialogs() which is now being called from wp_quicktags(). wp_quicktags, on his turn, is being called from the_editor() function. So, if you’re using the_editor() you no longer need to manually call the … Read more

Custom Tiny MCE button to bring up a custom php popup

This works: tinymce.create(‘tinymce.plugins.tinyplugin’, { init : function(ed, url){ ed.addButton(‘tinyplugin’, { title : ‘map’, onclick : function() { tb_show(“”, “../wp-content/plugins/myplugin/test.php?”); tinymce.DOM.setStyle([“TB_overlay”, “TB_window”, “TB_load”], “z-index”, “999999”) }, image: url + “/icon.png”, }); } }); The ? after the test.php is important or else the link will be broken.

Possible to stop WordPress from adding p1, p2… classes to p tags in TinyMCE?

I figured out how to strip those classes using TinyMCE’s paste_preprocess option. In your functions.php: add_filter(‘tiny_mce_before_init’, ‘customize_tinymce’); function customize_tinymce($in) { $in[‘paste_preprocess’] = “function(pl,o){ o.content = o.content.replace(/p class=\”p[0-9]+\”/g,’p’); o.content = o.content.replace(/span class=\”s[0-9]+\”/g,’span’); }”; return $in; } The value passed to paste_preprocess is a JavaScript function which will be executed whenever content is pasted into TinyMCE. The … Read more

TinyMCE in customizer

SwAt.Be, your own answer helped me a bunch and I’ve nailed the problem of printing admin scripts after the last rendition of wp_editor. Also see how I pass JS setup function as tinymce option to sync the editor changes with WP customizer to make it work properly. if (class_exists(‘WP_Customize_Control’)) { class WP_Customize_Teeny_Control extends WP_Customize_Control { … 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

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