Stop WordPress From Removing HTML Comments In Content

This is due to a very old WordPress HTML Comment bug, that was never fully fixed. You may use Gutenberg, it handles HTML comments better. Also, This Post suggests that placing a beginning HTML comment TAG, just before the ending HTML comment tag works. Like this: <!– some HTML Comment <!– –> This is valid … Read more

Disable the Code View in the content editor?

You can do it in JavaScript, though the downside is you have to do it block by block. You’ll need webpack set up with lodash installed: function removeHtmlEditing( settings, name ) { return lodash.assign( {}, settings, { supports: lodash.assign( {}, settings.supports, { html: false } ), } ); } wp.hooks.addFilter( ‘blocks.registerBlockType’, ‘core/paragraph’, removeHtmlEditing ); There’s … Read more

How to replace the content of tinyMCE editor in both text and visual mode using jQuery?

The first thing to do is to select the active editor. Here we select the editor using its id, which is content. var activeEditor = tinyMCE.get(‘content’); Then we use tinyMCE’s setContent: var activeEditor = tinyMCE.get(‘content’); var content=”HTML or plain text content here…”; activeEditor.setContent(content); However, if the editor is in text mode to begin with, after … Read more

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