Ok, I am going to create website in Urdu(rtl) & English(ltr) language that contain paragraphs like this: <p style="direction:rtl">کیا حال ہے buddy? سب خیریت ہے؟</p> You can see that sentence in not showing correctly. I want to change the direction of English words in sentense. like this: <p style="direction:rtl">کیا حال ہے <bdo dir="ltr">buddy?</bdo> سب خیریت ہے؟</p> You can see more clear differance at JSfiddle. How it is possible? Any idea?
The line breaks are stripped off when the p tag has a dir attribute inserted, to explain further I'll list some examples. Let's say we have 2 lines of text as following <p>Text Paragraph Number One Goes Here</p> <p>Text Paragraph Number Two Goes Here</p> If I want to add line breaks between the two paragraphs it works fine to become like: <p>Text Paragraph Number One Goes Here</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>&nbsp;</p> <p>Text Paragraph Number Two Goes Here</p> However if …
I've added a new button with a menu to the TinyMCE visual editor using this tremendously helpful tutorial but would now like to add further items to this menu depending on whether various post types are active in my theme. I think I'm on the right track with addMenuItem and 'context' but can't figure out how to set this up in the correct order. My plugin code: add_action('admin_head', 'nto_add_shortcode_button'); function nto_add_shortcode_button() { global $typenow; // check user permissions if ( …
I am not sure if it is possible or not. Can i use wp_localize_script with mce_external_plugins filter? I want to send a variable to the tinymce plugin script. For Example: add_filter( "mce_external_plugins", array( &$this, 'add_test_plugin' ) ); public function add_test_plugin( $plugin_array ){ global $pagenow; if( is_admin() && $pagenow == "post.php" || $pagenow == "post-new.php" ){ $plugin_array['mytest'] = plugin_dir_url(__FILE__) . '/js/testing.js'; return $plugin_array; } } I have to send a variable to testing.js? How do i achieve this? Update: this is …
I’ve defined some custom styles as directed in the article here, they work splendidly: https://codex.wordpress.org/TinyMCE_Custom_Styles However, I’d like to add keyboard shortcuts for these styles, and I’m unclear how to do that. It seems easy enough for custom defined buttons on the toolbar, but I don’t see any way to define them for the styles in the drop down. I have found this TinyMCE doc, https://www.tiny.cloud/docs/api/tinymce/tinymce.shortcuts, so I know shortcuts are supported, I just don't understand how to map them …
Looking for a way to make the TinyMCE editor always relative to it's content so that the height of the editor changes accordingly to how much text/images it contains. There seem to be plugins for TinyMCE for this already, but I'm not sure on how to apply it for the Wordpress version: http://www.tinymce.com/wiki.php/Plugin:autoresize function init_tinymce_autoresize($initArray){ $initArray['plugins'] = "autoresize"; return $initArray; } add_filter('tiny_mce_before_init', 'init_tinymce_autoresize'); Does not work. Ideas?
I'm currently writing a plugin that provides an interface for adding shortcodes, very simple dropdown added to the TinyMCE toolbar which opens a TinyMCE dialog box with text fields etc. This is all working great, the shortcode is created properly and inserted in to the main WP editor. However, I'm trying to set up a field which is a rich text editor in the dialog box but having some trouble getting it to initialise properly. Here's my TinyMCE plugin: 'use …
As above. I want to change the WordPress Edtior TinyMCE behavior when I click the underline button I want the TinyMCE to wrap my selection with <u></u> tags. Now, I know that the u tag was deprecated in HTML 4~ but according to W3 it can be used in HTML5 again. Anyways! I need a <u> tag - not a <span>. Is there a way to change the default underline button behavior without any shortcodes or editing core files? Something …
In the legacy (classic editor) it was possible to add buttons to the editor toolbar via tinymce API, that will add shortcode at cursor. seems like this is not supported anymore from the tinymce FQA and this Gutenberg migration guide Seems like it would be possible with the plugin tinymce advanced but I wonder what is today the best practice to add add a button to a tiny mce button to the the simple text editor of paragraph block. The …
I am stuck on silly issue of wp_editor function in WordPress backend in custom plugin page. See issue for wp_editor in attached images I have called the wp_editor function like this <?php wp_editor(stripslashes($item['custom_redirect_message']), "custom_redirect_message", array("wpautop" => false,"name" => "custom_redirect_message", "textarea_rows" => 20)); ?> There is also some js error in console in live environment when I click on link button in editor. The link button should not pop out like this. Any help in this highly appreciated. Thanks Edit:- When …
I want the Show blocks feature of the TinyMCE Visual Blocks Plugin to be activated for all users. I can activate the Show blocks feature under the View menu dropdown manually. See picture. This activates it for the current user. How can I activate the feature for all users? Can it be done via the tiny mce before init hook similar to setting visualblocks_default_state ? https://www.tiny.cloud/docs/plugins/visualblocks/ https://codex.wordpress.org/Plugin_API/Filter_Reference/tiny_mce_before_init
TinyMCE's Paste plugin automatically turns pasted image URLs into embedded images. https://www.tiny.cloud/docs/plugins/paste/ I need to disable this behavior since I use TinyMCE in a forum on the frontend and I don't want to allow image embedding.
I am using TinyMCE Advanced plugin according to qTranslate in a wordpress 3.3 installation. My question is: why does tinymce translate visual editor new line ("enter" key) in a <p>&nbsp;</p> instead of <br/>? Is it possible to change this behavior?
I'm trying to cutomise the TinyMce editor within WordPress and I took this code from an older WP site I did, but the buttons I have set don't seem to be working, for example, this is what I have: add_filter( 'tiny_mce_before_init', 'blm_format_tiny_mce' ); function blm_format_tiny_mce( $in ) { $in['remove_linebreaks'] = true; $in['convert_newlines_to_brs'] = false; $in['keep_styles'] = true; $in['tabfocus_elements'] = 'major-publishing-actions'; $in['paste_remove_styles'] = false; $in['paste_remove_spans'] = true; $in['paste_strip_class_attributes'] = 'mso'; $in['paste_text_linebreaktype'] = 'combined'; $in['plugins'] = 'tabfocus,paste,media,fullscreen,wordpress,wpeditimage,wpgallery,wplink,wpdialogs'; $in['theme_advanced_buttons1'] = 'formatselect,forecolor,|,bold,italic,underline,|,bullist,numlist,blockquote,|,justifyleft,justifycenter,justifyright,justifyfull,|,link,unlink,|,wp_adv'; $in['theme_advanced_buttons2'] = …
I created an img shortcode (e.g. [img attachment="19"]) that I want to render in real time in TinyMCE visual editor. So, I created a plugin for TinyMCE that replaces the shortcode in real time. Here is a portion of the Javascript code I wrote (inspired by this tutorial): (function() { tinymce.create('tinymce.plugins.mypluginname', { init : function(ed, url) { var t = this; t.url = url; //replace shortcode before editor content set ed.onBeforeSetContent.add(function(ed, obj) { obj.content = t._do_spot(obj.content); }); //replace shortcode as …
Making a custom plugin for TinyMCE, I wonder how to make a word automatically selected based on current cursor position, like in the the Wordpress "Add link" plugin. I've searched the WP TinyMCe Wplink code and TinyMCE Docs but I've got no reference....
I'm sold on this one. A client has reported he can't edit any text on posts or pages on his WordPress site, claiming the visual editor text is white and he can't click on any buttons. Not even the HTML tab works. He sent me a screenshot where I can see his text is appearing on white (even with red markings from the spellchecker) and TinyMCE buttons are not loaded. He reports the same error using both the latest Firefox …
I am using a custom MCE button in my wordpress custom plugin below is my code function enqueue_plugin_scripts($plugin_array) { //enqueue TinyMCE plugin script with its ID. $plugin_array["related_post_button"] = plugin_dir_url(__FILE__) . "index.js"; return $plugin_array; } add_filter("mce_external_plugins", "enqueue_plugin_scripts"); and the js index.js is (function() { tinymce.create("tinymce.plugins.related_post_button", { //url argument holds the absolute url of our plugin directory init : function(ed, url) { //add new button ed.addButton("related_btn", { title : "Add Related post shortcode", cmd : "related_command", icon: "custom-mce-icon", }); //button functionality. ed.addCommand("related_command", …