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

How can I set the height of the classic editor per post-type?

One way is to adjust the TinyMCE settings: add_filter( ‘tiny_mce_before_init’, function( $settings ) { $settings[‘height’] = ‘120’; $settings[‘autoresize_max_height’] = ‘120’; return $settings; } ); and e.g. restrict further on post types and !block editor with get_current_screen(). Example: add_filter( ‘tiny_mce_before_init’, function( $settings ) { $screen = get_current_screen(); if ( $screen->is_block_editor() ) { return $settings; } if … Read more

How can I make the page editor trust me?

To avoid the line break when posting 2 images side by side assign the alignleft or alignright class to them and put them on the same line in the editor without skipping any spaces between them. Example: <img src=”https://wordpress.stackexchange.com/wp-content/uploads/your_image.jpg” alt=”” class=”alignleft” /><img src=”/wp-content/uploads/your_image2.jpg” alt=”” class=”alignright” /> Edit I forgot to mention that content after the … Read more

Keyup events in tinymce editor not working

You can create a new plugin with the mce_external_plugins filter.. and link it to a js file. Then, in that file you can do your processing. function tinymce_init() { // Hook to tinymce plugins filter add_filter( ‘mce_external_plugins’, ‘tinymce_plugin’ ); } add_filter(‘init’, ‘tinymce_init’); function tinymce_plugin($init) { // We create a new plugin… linked to a js … Read more

allowing all HTML tags in tinymce editor

[*] Try this function from leighton.com : function override_mce_options($initArray) { $opts=”*[*]”; $initArray[‘valid_elements’] = $opts; $initArray[‘extended_valid_elements’] = $opts; return $initArray; } add_filter(‘tiny_mce_before_init’, ‘override_mce_options’); Hope that helps. [*]

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