Tinymce/WordPress is removing all line-breaks?

You may need to use one of the following configuration parameters: // Don’t remove line breaks ‘remove_linebreaks’ => false; // Convert newline characters to BR tags ‘convert_newlines_to_brs’ => true; WordPress passes an $init argument array to TinyMCE that sets the opposite value for each of these parameters. I assume you can pass them directly in … Read more

Remove “Are You Sure” dialogue when leaving editor

You can use the method described here. Add the following to your functions.php <?php function wpse35898_admin_head() { ?> <script type=”text/javascript”> window.onbeforeunload = function() {}; </script> <?php } add_action( ‘admin_head’ , ‘wpse35898_admin_head’ ); ?>

Saving (Updating) Post / Page Edits With AJAX

The german (core) developer Dominik Schilling/ocean90 has released a pretty nice, simple and small plugin to encounter (part of) this problem. Instead of adding a complex AJAX save process, that would just make it harder to work with even handlers and such (de- & re-registering them), he just added a position marker, that allows WP … Read more

HTML5, WordPress and Tiny MCE issue – wrapping anchor tag around div results in funky output

[*] You need to modify the TinyMCE settings, specifically the valid_children setting. To accomplish this in WordPress, use the tiny_mce_before_init filter reference. Something like this (untested): add_filter(‘tiny_mce_before_init’, ‘modify_valid_children’); function modify_valid_children($settings){ $settings[‘valid_children’]=”+a[div|p|ul|ol|li|h1|h2|h3|h4|h5|h5|h6]”; return $settings; } You may be able to use +a[*] to capture all elements, but you’ll want to take care to avoid nested anchor … Read more

Remove hidden formatting when user paste text from MS Word into TinyMCE

I am interpreting the question to mean that you already have Word markup in your post and so you need to clean that up via PHP. If so… You can see the code that cleans up Word content here: http://core.trac.wordpress.org/browser/trunk/src/wp-includes/js/tinymce/plugins/paste/editor_plugin_src.js#L375 That is Javascript. With some work, you could convert that to PHP. PHP Tidy, if … Read more

Detect a focus on wp_editor

You can pass an array of settings to the editor instance. For possible values please refer to the tinymce documentation, in your case ‘init_instance_callback’ might be helpful. https://www.tinymce.com/docs/configure/integration-and-setup/#init_instance_callback wp_editor(”, ‘sedemoeditor’, array( ‘tinymce’ => array( ‘init_instance_callback’ => ‘function(editor) { editor.on(“focus”, function(){ console.log(“Editor: ” + editor.id + ” focus.”); }); }’ ) ));

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