Icons are missing from Visual Editor

After a few more days of frustrating testing, I managed to track the issue down to the External Links Rewrite option in Siteground’s Site Tools, under SSL options. When HTTP Enforce is enabled with the optional External Links Rewrite option (being able to see these changes virtually immediately in the browser requires a Force Refresh, … Read more

how can default_content filter tell if content will load in block editor or classic editor?

Looks like WP_Screen::is_block_editor() is what you want. Here’s some rough code to demonstrate: add_filter( ‘default_content’, function( $content, $post ) { $screen = function_exists( ‘get_current_screen’ ) ? get_current_screen() : null; $is_block_editor = $screen ? $screen->is_block_editor() : false; if ( $is_block_editor ) { // Do your block editor stuff here } else { // Do your classic … Read more

How to sync the style in the visual editor with the style of a child theme?

The parent theme’s functions.php has two functions to manage the editor styles. They are twentytwenty_classic_editor_styles() and twentytwenty_block_editor_styles() and they’re both hooked to init. For example, the classic editor function reads: function twentytwenty_classic_editor_styles() { $classic_editor_styles = array( ‘/assets/css/editor-style-classic.css’, ); add_editor_style( $classic_editor_styles ); } add_action( ‘init’, ‘twentytwenty_classic_editor_styles’ ); To override those styles, copy both of those functions … Read more

Automatically replace &nbsp with space

Yes, this is possible. You could do it when saving the post, or just when rendering (which won’t change the actual content in the editor). Using the_content filter, replacing characters in rendering: function wpse_387560( $content ) { $content = str_replace( ‘ ’, ‘ ‘, $content ); return $content; } add_filter( ‘the_content’, ‘wpse_387560’ ); Using the wp_insert_post_data … Read more

How to force insertion in editor

Facilitating users to write content in an external editor, and then copy/paste it into the WordPress editor, is a fundamentally bad approach, and is fraught with issues. The WordPress editor is intended to be used to write content. You should train your users to use the post editor to write content, as opposed to using … Read more

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