How to keep   non-breaking spaces in the visual editor?

This seems to do it: function allow_nbsp_in_tinymce( $mceInit ) { $mceInit[‘entities’] = ‘160,nbsp,38,amp,60,lt,62,gt’; $mceInit[‘entity_encoding’] = ‘named’; return $mceInit; } add_filter( ‘tiny_mce_before_init’, ‘allow_nbsp_in_tinymce’ ); Also see: https://www.tinymce.com/docs/configure/content-filtering/#entities Any improvement suggestions?

Shortcode to insert

Best solution for what you want to accomplish which is essentially to make the next page feature more user friendly for your authors is to add a TinyMCE button that will do this for you. This may be a bit complicated so hold your hat. To avoid this answer being the length of a thesis, … Read more

How to disable Gutenberg editor?

Yes, you can disable it. You can do this with code If you want to disable it globally, you can use this code: if ( version_compare($GLOBALS[‘wp_version’], ‘5.0-beta’, ‘>’) ) { // WP > 5 beta add_filter( ‘use_block_editor_for_post_type’, ‘__return_false’, 100 ); } else { // WP < 5 beta add_filter( ‘gutenberg_can_edit_post_type’, ‘__return_false’ ); } And if … Read more

Change behavior of “Insert into Post” based on attachment metadata

In case it’s helpful to anyone else, here’s what my code looked like to achieve this. I didn’t end up saving the attachment data at all, per tbuteler’s suggestion, but rather than using $_REQUEST I found I could use the $attachment array directly: function my_attachment_fields_to_edit( $form_fields, $post ) { $supported_exts = supported_types(); // array of … Read more

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