Lost formatting after saving

After a lot of research (2 day) i finally found a plaster… it’s not a fix, but it make the editor work for most of the work. Here is the code to add to function.php of the theme: function cbnet_tinymce_config( $init ) { $init[‘remove_linebreaks’] = false; $init[‘convert_newlines_to_brs’] = true; $init[‘remove_redundant_brs’] = false; return $init; } … Read more

How to make WordPress and TinyMCE accept tags wrapping block-level elements as allowed in HTML5?

[*] A few years down the track, but hopefully someone else will find this solution useful… Although my issues trying to get this sort of thing to work in WordPress were slightly different, hopefully this solution will work for you too. Firstly, the issue with tags not being allowed to contain multiple block level elements … Read more

Theme Advanced Styles in Visual Editor and Paragraphs

If you always want <br/> instead of <p> for newlines you can change the TinyMCE configuration: forced_root_block: false, force_br_newlines: true, force_p_newlines : false, I think you cannot do this based on the context (use <br/> when in class=”box_note”, <p> otherwise), but it is an interesting question for the TinyMCE forum. Shift+Enter is indeed the standard … Read more

How to enable visual editor when editing comments on the dashboard?

If you are using WordPress 4.0+ you can do this using the wp_editor_settings and the global $pagenow to determine if you are on the comments page. add_filter( ‘wp_editor_settings’, ‘remove_editor_quicktags’, 10, 2 ); function remove_editor_quicktags( $settings, $id ){ global $pagenow; if ( $id == ‘content’ && $pagenow === ‘comment.php’ ){ $settings[‘quicktags’] = false; $settings[‘tinymce’] = true; … Read more

Restrict file uploads by extension?

I believe you can add a filter to upload_mimes to restrict to certain types. The hook: http://adambrown.info/p/wp_hooks/hook/upload_mimes The filter: add_filter(‘upload_mimes’,’restict_mime’); function restict_mime($mimes) { $mimes = array( ‘jpg|jpeg|jpe’ => ‘image/jpeg’, ‘gif’ => ‘image/gif’, ‘png’ => ‘image/png’, ); return $mimes; } From what I understand this will not work for admins or any user with the unfiltered_upload … Read more

Pasting images removes class attribute

Instead of pasting into the Visual editor, switch to the html editor for pasting any kind of html, or using shortcodes. I’d recommend checking the “disable the visual editor” checkbox in your user profile. Then install Mark Jaquith’s Markdown on Save plugin for more readable formatting without the wysiwyg pitfalls.

How to enable user_can_rich_edit for guests?

Just add the can_richedit capability to the user you want to be able to use the editor. You can use the Capability Manager to do it. Update: to enable the rich editor on anonymous/guest users, add this to your funcitons.php or anywhere you like, just make sure it comes before the wp_editor() call. add_filter(‘user_can_richedit’, ‘__return_true’);

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