TinyMCE editor is breaking my beautiful HTML

This is pretty much an exact duplicate of: How to make WordPress and TinyMCE accept <a> tags wrapping block-level elements as allowed in HTML5? and HTML5, WordPress and Tiny MCE issue – wrapping anchor tag around div results in funky output My problem is that the suggested solution (tiny_mce_before_init filter) doesn’t seem to solve my … Read more

how to fix a broken visual editor

Our visual editor is displaying raw HTML: If I click on Visual or Text, nothing happens at all – the click isn’t registering. My profile does not have “disable visual editor” checked. The same thing happens in Chrome, Opera & Firefox. I have disabled all themes and plugins without change. I have uploaded /wp-admin & … Read more

Forcing reload of editor-style.css

Is there a method to force the refresh of editor-style.css, when I change manually the stylesheet for the TinyMCE editor? Modification doesn’t show immediately but they will be cached in the admin side of administration backend. For example like this: editor-style.css?ver=3393201 5 There is a hook for that: ‘mce_css’. It is called in _WP_Editors::editor_settings() and … Read more

Add custom options to the wplink dialog

I managed to add a custom option-select for images with function attachment_field_credit( $form_fields, $post ) { $field_value = get_post_meta( $post->ID, ‘first_image’, true ); $isSelected1 = $field_value == ‘1’ ? ‘selected ‘ : ”; $isSelected2 = $field_value != ‘1’ ? ‘selected ‘ : ”; $form_fields[‘first_image’] = array( ‘label’ => __( ‘Use as first image’ ), ‘input’ … Read more

Adding Custom Text Patterns in the WP 4.5 Visual Editor

4.5 is out and with it new Text Patterns. I would like to know how to go about adding my own custom patterns. Taking a look at wp-includes/js/tinymce/plugins/wptextpattern/plugin.js it seems pretty straight forward. var spacePatterns = [ { regExp: /^[*-]\s/, cmd: ‘InsertUnorderedList’ }, { regExp: /^1[.)]\s/, cmd: ‘InsertOrderedList’ } ]; var enterPatterns = [ { … Read more