How to disable formatting

Please use this code in your functions.php function tinymce_paste_as_text( $init ) { $init[‘paste_as_text’] = true; return $init; } add_filter(‘tiny_mce_before_init’, ‘tinymce_paste_as_text’); For details please follow link : This will paste copied text in plain format

WordPress’ visual editor messing up my (nested) lists (and other things as well)

Instead of using the “type” attribute, try adding a CSS class and styling that. <ol> <li>Number one</li> <li>Number two <ol class=”lower-alpha”> <li>Lowercase a</li> <li>Lowercase b <ul> <li>Paragraph 1</li> <li>Paragraph 2</li> </ul> </li> </ol> </li> </ol> Then in your CSS – depending on your site setup, you may want to add Custom CSS through the Customizer, … Read more

Switching From HTML to Visual Editor and Back Completely Strips Page Contents

I’ve had this code in a custom local plugin for a while. Or you could just stick it in your theme’s functions.php: // Allow iframe in TinyMCE function tinymce_add_iframe( $arr = array() ) { $extra=”iframe[id|class|title|style|align|frameborder|height|longdesc|marginheight|marginwidth|name|scrolling|src|width]”; if ( isset( $arr[‘extended_valid_elements’] ) ) { // append to existing value $arr[‘extended_valid_elements’] .= ‘,’ . $extra; } else { … Read more

Limiting allowed html elements/strip harmful scripts from editor

Adjust HTML-Filter: <?php function fb_change_mce_options($initArray) { // Comma separated string od extendes tags // Command separated string of extended elements $ext=”pre[id|name|class|style],iframe[align|longdesc|name|width|height|frameborder|scrolling|marginheight|marginwidth|src]”; if ( isset( $initArray[‘extended_valid_elements’] ) ) { $initArray[‘extended_valid_elements’] .= ‘,’ . $ext; } else { $initArray[‘extended_valid_elements’] = $ext; } // maybe; set tiny paramter verify_html //$initArray[‘verify_html’] = false; return $initArray; } add_filter(‘tiny_mce_before_init’, ‘fb_change_mce_options’); ?> … Read more

How to get Text Selection in WordPress Editor

The visual editor is an TinyMCE implementation. The first way to repace a selected text, is to write a plugin for the TinyMCE. If you do not want to write a plugin, use the tinyMCE object: add_action( ‘admin_footer’, ‘tinyNagging’ ); function tinyNagging() { echo ‘ <script type=”text/javascript”> jQuery(document).ready( function() { window.setInterval( function(){ var selectedText = … Read more

How to reset display of WYSIWYG editor

Looks like the Theme you are using adds style to the editor using add_editor_style(). Check for that code in theme files and just comment it out by adding a // so that it looks like //add_editor_style( … );. Alternatively, you can look for a file named editor-style.css in theme’s root directory and rename it to … Read more

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