Custom post type editor uses old tinyMCE

In your code where you defined your custom post type (in a custom plugin or in your functions.phpfile), you need to add this snippet for Gutenberg block editor support: ‘show_in_rest’ => true, ‘supports’ => array(‘editor’) Here is an example: function portfolio_post_type() { register_post_type( ‘portfolio’, array( ‘labels’ => array( ‘name’ => __( ‘Portfolio’ ), ‘singular_name’ => … Read more

Pass data back to TinyMCE from Thickbox

Okay so I spit through some existing themes I have to try and figure out how to achieve this. If anyone is reading this, this is how I did it: In the onclick function of the TinyMCE I called the ajax form and then inside the form I added some javascript that uses the tinyMCE.activeEditor.execCommand(‘mceInsertContent’, … Read more

Tiny MCE doesn’t look anything like my blog

You can add an editor-style.css stylesheet in your theme which mimics the look-and-feel of your blog. Here are some tips on how to do that (you’ll need to touch functions.php too): http://www.deluxeblogtips.com/2010/05/editor-style-wordpress-30.html The first two styles in that example are the important ones; usually what I do is just copy over and rename my style.css … Read more

Custom TinyMCE Editor Formats in Dropdown

You can group styles using the items key – you can nest multiple times too! /* TINY MCE FORMATE */ function my_mce_before_init_insert_formats( $init_array ) { $style_formats = array( array( ‘title’ => ‘Buttons’, ‘items’ => array( array( ‘title’ => ‘Green’, ‘selector’ => ‘a’, ‘classes’ => ‘btn–green’ ) array( ‘title’ => ‘Blue Button’, ‘selector’ => ‘a’, ‘classes’ … Read more