How can the tinyMCE dom be manipulated (offical API does not seem to work)?

Hope You can use fallowing // Sets class attribute on all paragraphs in the active editor tinymce.activeEditor.dom.setAttrib(tinymce.activeEditor.dom.select(‘p’), ‘class’, ‘myclass’); // Sets class attribute on a specific element in the current page tinymce.dom.setAttrib(‘mydiv’, ‘class’, ‘myclass’); or You can add Id by jquery like this $(‘div’).find(‘p’).attr(‘id’, ‘myid’);

wp_localize_script with mce_external_plugins in wordpress

If I understand correctly; you just need to make a Javascript variable available to testing.js. I think it would be just as useful to send the variable with jQuery, as that would be loaded prior to TinyMCE anyway: add_action(‘wp_enqueue_scripts’, ‘YOUR_NAME_scripts’); //back end function YOUR_NAME_scripts( $hook_suffix ) { global $blog_id; $params = array( ‘site_url’ => site_url(), … Read more

Tinymce – How to hook before or after live shortcodes rendering?

Well, yes, you can do that: //replace live edited content to display html editor.on(‘BeforeSetcontent’, function(event){ event.content = tinymce_to_html( event.content ); }); //Transform your html content to raw content editor.on(‘GetContent’, function(event){ event.content = html_to_tinymce( event.content ); }); Let’s explain that: Under the hood, tinymce use a plain-text editor to store content, use in forms, etc etc. … Read more

TinyMCE Advanced newline problem

Go into Settings -> TinyMCE Advanced, and check the option Stop removing the <p> and <br /> tags when saving and show them in the HTML editor. This will allow you full control over those tags inside the HTML view. For a single line break without overriding the editor, use Shift+Enter. To override the editor … Read more

Adding Custom Text Patterns in the WP 4.5 Visual Editor

Here’s a way to test the core patch #33300.6 by Andew Ozz, through a test plugin in WP 4.5.2, to try out the text pattern filter. Demo Here’s a strikethrough example using ~ $init[‘wpsetextpattern_inline_patterns’] = ‘{ strong: { start: “*”, end: “*”, format: “bold” }, strong2: { start: “**”, end: “**”, format: “bold” }, em: … Read more

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