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. [*]

customize tiny MCE blockqute

If it’s for styling purpose, the fastest solution I could think of is by using Javascript. As far as I know, modifying the output of TinyMCE tag would require editing of WordPress core files, so it’s more practical to append a <span> with Javascript. Something like this would do: <script type=”text/javascript> $(‘.post blockquote’).wrapInner(‘<span />’); </script> … Read more

Qtranslate + Woocommerce (multiple tinymce) [closed]

Do you absolutely have to use qTranslate to do it? If not, read the official documentation for recommended method of translation: http://docs.woothemes.com/document/woocommerce-localization/ Also try any plugin that is made to integrate with WooCommerce such as WPML. Fixing compatibility between two plugins that is not integrated is not really worth the trouble. They are going to … Read more

Translate MCE button text/tooltip in custom plugin

Create js file button.js and add js directory and list-btn.png needed (function() { tinymce.create(“tinymce.plugins.listbuttons_button_plugin”, { //url argument holds the absolute url of our plugin directory init : function(ed, url) { //add new button ed.addButton(“listbuttons”, { title : “Add Related post shortcode”, cmd : “listbuttons_command”, image : “images/list-btn.png” }); ed.addCommand(“listbuttons_command”, function() { var return_text = “[related]”; … Read more

TinyMCE buttons that launch Ajax-generated forms

by using jQuery.ajax(): so, instead of that big form variable: $.ajax({ type: ‘GET’, url: ‘admin-ajax.php’, data: { action: ‘get_my_form’ }, success: function(response){ var table = $(response).find(‘table’); // you don’t seem to use this “table” var $(response).appendTo(‘body’).hide(); // … } }); Now, the php: add_action(‘wp_ajax_get_my_form’, ‘get_my_form’); function get_my_form(){ // build your form here and echo it … Read more