/** * Auto-add https:// to links in the Classic Editor via JavaScript * Triggers when the user clicks 'Apply', hits 'Enter', or leaves the input field. */ function auto_add_https_classic_editor_js() { // Only run this script on admin pages where the editor might be present $screen = get_current_screen(); if ( ! $screen || ! in_array( $screen->base, array( 'post' ) ) ) { return; } ?> tags to red. $custom_css = '#tinymce a { color: #3858E9 !important; } #tinymce a:hover { text-decoration: underline !important; }'; // Inject the CSS into TinyMCE's content_style array if ( isset( $init_array['content_style'] ) ) { $init_array['content_style'] .= ' ' . $custom_css; } else { $init_array['content_style'] = $custom_css; } return $init_array; } // Hook into TinyMCE initialization add_filter( 'tiny_mce_before_init', 'custom_classic_editor_styles' );