Questions tagged [tinymce]

TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under LGPL. TinyMCE has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.

Filter by
Sorted by
Tagged with
0
votes
0answers
45 views

Prevent $ from being replaced by $ when switching between HTML and Visual

Scenario: I need to use the html entity $ instead of plain $ in my posts. I use the Wordpress Classic editor. I know that tinyMCE, with good intentions, alters its content when switching ...
0
votes
0answers
135 views

Setting default content when using wp.editor.initialize

I am trying to add default content when I fire wp.editor.initialize(). This is code. wp.editor.initialize( editor_id, { mediaButtons: true, quicktags: true, tinymce: { ...
0
votes
1answer
312 views

How to add table class for tables of TinyMCE advanced wordpress plugin? [closed]

If you want to add a class for tables created using tinyMCE advanced wordpress plugin. Please see my answer.
0
votes
1answer
19 views

Client on iPad accidentally adding <code> tag to posts while writing

A client of mine complains that text gets 'randomly highlighted' when he is writing Wordpress posts on his iPad Pro. He uses the web interface. I got him to stop deleting the 'highlighted' text and ...
0
votes
1answer
24 views

Add custom TinyMCE 4 Button: Is it mandatory to have one JS per button?

I'm editing a Wordpress Plugin, trying to add another button. I had a look to this question (Add custom TinyMCE 4 Button, Usable since WordPress 3.9-beta1). But it doesn't work The JS file: https://...
1
vote
1answer
443 views

Multiple Tinymce/wp_editor in WordPress >4.8

I'm struggling for two days and started here with success: Why Can't wp_editor Be Used in a Custom Widget? I managed to have multiple TMCE on one page (displayed by a widget); all save data ...
0
votes
0answers
118 views

Deny php execution in /wp-includes - using .htaccess in /wp-includes VS root folder

Trying to secure my WP site. In an attempt to deny php execution from the wp-includes folder wondering if these two methods are effectively doing the same thing? 1) add new .htaccess file to root of ...
0
votes
1answer
23 views

Show image gallery from a custom field

I have a custom field in a custom post type. The custom field is a tinymce editor and I should echo out what user enters on it. If user enters text it is shown as well but when an image or a gallery ...
1
vote
0answers
48 views

How to edit content before post update

I'm creating a plugin that enables the user to highlight certain words (long words, long sentences etc.) in the TinyMCE Editor. You can see a live version here: https://tekstr.dk/app I'm converting ...
0
votes
1answer
360 views

Adding custom block formats to TinyMCE. Everything works until JavaScript error when applying the format

I'm trying to add an item into the block formats dropdown in TinyMCE. I would like to add a format called "Heading 2 Light". In functions.php I add this code: function theme_tiny_mce_before_init( $...
0
votes
2answers
162 views

Remove distraction free mode from teeny editor

I'm trying to remove the distraction free mode button from the editor, but i can't make it disapear. Here is the code im using: add_filter( 'wp_editor_settings', function($settings) { $...
0
votes
0answers
50 views

“Formats” Select Menu in WP Editor doesn't show up with correct colour

I added the Dropdown "Formats" and defined some custom styles. The followed tutorial is in this section. Everything is correct, but there's a small issue: My custom formats titles within the ...
3
votes
1answer
263 views

Tiny MCE editor stripping xlink:href parameter from SVG USE tag

I have an inline SVG tag with an embedded <USE> tag. HTML: <ul> <li><svg class="icon-user"><use xlink:href="#icon-user"></use></svg> My Account</li>...
1
vote
0answers
51 views

Popup box when Clicking on Insert into post button in wordpress

I need to show a alert popup on clicking Insert into Post button in Media Library of WordPress, if the selected Image is less than some width and height in Library. Where can I find the onClick event ...
0
votes
1answer
307 views

TinyMCE 4.7.11 - Enable hidden WordPress core plugins? (referencing a wp-includes from plugin.php)

I need a color picker for the visual editor (don't ask, not my idea). I thought the TinyMCE colorpicker plugin was removed in WordPress 3.9. However, I do see site/wp-includes/js/tinymce/plugins/...
2
votes
0answers
98 views

TinyMce in WordPress - Getting the “fullscreen” button to stay on the right when customising button layout

I'm using TinyMce inside WordPress and I have customised the button layout like so: add_filter( 'tiny_mce_before_init', 'blm_format_tiny_mce' ); add_filter( 'mce_buttons', '...
1
vote
0answers
41 views

trigger html cleanup for all posts

So i know that wordpress will auto clean / format html within posts / pages automatically when switching back and forth from text to visual: https://stackoverflow.com/questions/9907757/wordpress-...
2
votes
2answers
536 views

Customising the WordPress TinyMce editor and it's buttons

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: ...
1
vote
1answer
114 views

TinyMCE 4.7.11 custom styles using styleselect - what does the 'attributes' argument do?

I'm writing a plugin to add custom formats to TinyMCE using styleselect. I've scoured the documentation and hundreds of examples covering the inline, block, selector, classes, and wrapper arguments. ...
1
vote
1answer
83 views

How to reset 'Advance' tab on table property?

I want to use bootstrap table in my site without any mess up class, style. I just want to add bootstrap class. I can add these class in table properties general settings as follows: function ...
0
votes
1answer
98 views

Prevent markup being altered when switching between Visual and HTML editors

I've seen this question asked a few times, but none of the solutions have worked for me. Basically, when switching between TinyMCE and the HTML editor, my markup gets ruined. I have a nested list on ...
3
votes
1answer
1k views

Integrating inline tinymce editor in a component for a gutenberg block

I'm new to stack exchange. I hope my question is not to long. I want to integrate an inline tinymce editor in a component and use it in a gutenberg block. But my editors ui conflicts with gutenberg. (...
0
votes
1answer
172 views

Text View (Code View) in WordPress Customizer TinyMCE Editor

I have implemented TinyMCE Editor in WordPress Customizer by putting this code in functions.php file: // TinyMCE Editor in Customizer if (class_exists('WP_Customize_Control')) { class ...
1
vote
1answer
199 views

Stop WordPress Visual Editor converting backticks into code blocks

I need my frontend wp_editor() to not convert backticks into code automatically. I have checked the settings config in the tiny_mce_before_init filter as well as the documentation on the TinyMCE ...
0
votes
0answers
156 views

TinyMCE function causes issue in AVADA theme

I use Avada Theme 5.5.2 + WP and discover an issue that is caused by the function my_tinymce_setup_function( $initArray ). When using this function it updates correct the into the tables. But in the ...
1
vote
0answers
261 views

How to Add TinyMCE to widget

I'm trying to create simple widget with TinyMCE rich editor but it's not working My widget code: add_action('widgets_init', 'string_example_name_init'); function string_example_name_init() { ...
3
votes
2answers
1k views

TinyMCE custom styles remove class when switching styles

I have added some custom styles to the TinyMCE editor using the tiny_mce_before_init filter hook. They work by adding classes to the block-level element. See the code below: function ...
1
vote
0answers
280 views

Custom Shortcode: define cursor position/insertion point?

I have created a shortcode and TinyMCE plugin for a shortcode. Click the button, it inserts [my-shortcode][/my-shortcode]. But it adds the code and then the editor cursor is after the closing ...
1
vote
1answer
217 views

WordPress Tinymce editor broken and nothing seems to fix it :(

First off, i've tried stuff posted here already, didnt help. Issue : Here is what i tried Tried renaming htaccess removing all plugins removing and reinstalling theme (there is only one ) tried ...
0
votes
1answer
39 views

Changing code with (&nbsp;) when author updates their post (TinyMCE)

I have a problem like this: every save changes code <td></td> to <td>&nbsp;</td> which is terrible beacause I have big tables and it makes final code much bigger and ...
3
votes
0answers
53 views

How can I use the TinyMCE editor for the description field on a Media item?

When I view an image in my Media Library, the Description field textarea has a toolbar, but it's only for creating HTML tags. How can I get the TinyMCE wysywig editor to be used instead? I've found ...
1
vote
0answers
60 views

Asynchronously render shortcodes in TinyMCE visual editor

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 ...
1
vote
0answers
60 views

TinyMCE custom plugin, how to make a word automatically selected based on current cursor position?

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 ...
4
votes
2answers
428 views

Wait for Gutenberg or built something in ACF?

I have a client who has requested something, that's straight out of the box, if I was using ACF. However... Gutenberg should be here any minute now and revolutionize who the editor works. I've looked ...
1
vote
0answers
74 views

Visual editor not showing all table rows

Does anyone know why the visual editor does not show all table rows. I have over 30 rows of data, but in the visual editor only ten are visible, the text editor is the only way to access the rest. ...
2
votes
2answers
438 views

Using a dashicon for a custom button in TinyMCE?

I have created a custom button for TinyMCE and I would like it to use the Twitter icon from dashicons. I am hoping to be able to do this just through the Javascript with no additional CSS. Is this ...
1
vote
1answer
1k views

onClick inside post_content does not appear in post tinymce editor

I'm doing a migration. I made a PHP script to generate posts in the new WordPress database. The post content contains an HTML link containing href="javascript:" and onClick="trackOutboundLink('url')"....
0
votes
0answers
64 views

How to get values from Tinymce visual editor popup?

Hello this is mi first question here I hope I get some answer, since i ve seen lots of unanswered questions. I am making a plugin and I need to save values entered in tinymce button popup. The ...
0
votes
1answer
2k views

Javascript function not working when placed in Text Block

I am trying to include a button that when clicked will copy the text from a textbox to the clipboard. I have placed the following code at the end of my text block (in Text View). Copy the important ...
0
votes
0answers
255 views

Understanding automatic text formatting in the Wordpress editor

Why does the text editor remove paragraphs and line breaks? Surely maintaining basic formatting such as paragraphs or line breaks is a basic requirement in all CMS systems. It's hard to believe that ...
1
vote
1answer
390 views

Translate MCE button text/tooltip in custom plugin

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["...
0
votes
1answer
124 views

Preserve indentation, HTML5 shorthand in editor

I know there are other questions about tinyMCE, but this one is a little different. Let's say I create an unordered list that drops the closing li tags. I also have class attributes that I don't want ...
2
votes
1answer
1k views

TinyMCE get selected text and underlying HTML

I already have a custom TinyMCE button that returns the selected text using var selected = tinyMCE.activeEditor.selection.getContent(); However, when a user creates a WordPress "link" like this... ....
0
votes
1answer
29 views

Wordpress Editor without buttons

I'm trying to add Worpdpress editor on a modal page and in a different php file, but it doesn't show me the buttons, I put the screenshot Also in the php file, First I hidden the editor to load the ...
0
votes
1answer
368 views

Nested ordered list in tinymce

I'm trying to change the behavior of tinymce regarding ordered list (using the plugin advlist), actually if i type an ordered list i've got this html : <ol> <li>first item</li> &...
0
votes
0answers
331 views

Custom Post Type archive link in WYSIWYG editor

I would like to add a link in the WYSIWYG editor to the archive page for a custom post type. I have a custom post type case-studies and would like to add a link to the archive page in the tinyMCE ...
0
votes
1answer
965 views

tiny_mce_before_init is not trigger

I'm trying to Clean up pasted text in WordPress and so I've decided to followed the instructions of this tutorial. It seems simple just to add a filter on before_wp_tiny_mce and add a setting to ...
0
votes
3answers
108 views

How to i style the elements from the TinyMCE

if i have a paragraph with class "test" in the TinyMCE editor how do i style the paragraph using my style.css file in my theme or do i need to make a separate file and if so how would i go about that?...
-1
votes
1answer
364 views

Add new MCE button for toggle specific cell background color

I'm using tables as a calendar for free dates in my schedule. You can see free dates here. http://www.zachrannastanicelipec.cz/smysly-terminy/ Now I'm using the Table->Cell->Cell Properties->...
1
vote
0answers
312 views

Documentation for adding a tinyMCE view for visual live preview of custom shortcode?

I'm trying to add a WYSIWYG visual representation for a custom shortcode into the tinyMCE editor but I can barely find any information on how to do that. Researching the last few days resulted in ...