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
145 votes
7 answers
63k views

Disable emojicons introduced with WP 4.2

So WP 4.2 introduced emojis (smileys) that basically adds JS and other junk all over your pages. Something some people may find shocking. How does one completely erase all instances of this?
  • 8,701
39 votes
2 answers
65k views

How to add a shortcode button to the TinyMCE editor?

How to make any plugin icon in wordpress post? The code I want to insert in plugin code and will appear in post bar [wp-admin/post.php]. Like this image: Output: If I click the icon it automatically ...
  • 653
26 votes
3 answers
41k views

TinyMCE: adding CSS to format dropdown

I successfully added a TinyMCE stylesheet using add_editor_style() so that I can preview the styles in the body of the TinyMCE editor. However, am I right in assuming that the add_editor_style() ...
  • 499
26 votes
4 answers
35k views

How do I include a TinyMCE editor in the frontend?

I am trying to add a TinyMCE editor in my frontend from where users can post but have had no luck so far. Here is the code: PHP: add_action('wp_print_scripts', 'my_enqueue_scripts'); function ...
  • 7,715
26 votes
1 answer
943 views

Adding Custom Text Patterns in the WP 4.5 Visual Editor

4.5 is out and with it new Text Patterns. I would like to know how to go about adding my own custom patterns. Taking a look at wp-includes/js/tinymce/plugins/wptextpattern/plugin.js it seems pretty ...
  • 9,589
23 votes
7 answers
25k views

Extra TinyMCE editor strips <p> and <br> tags?

Hey guys, I've added a TinyMCE to some textareas that are displayed in a custom meta box. All of the formatting works perfectly fine, except that the editor will not save <p> or <br/> tags....
  • 4,816
22 votes
3 answers
6k views

Switch between Visual and HTML tab freely

So this question has been raised many times under different flags, however I'd like to present a unified thread for an ultimate solution to this issue. In WordPress, by default, when switching back ...
21 votes
3 answers
18k views

Add custom TinyMCE 4 Button, Usable since WordPress 3.9-beta1

How is it possible to add a custom button to the visual editor TinyMCE, Version 4? Currently I found this q&a with a little bit hints to the topic, but not a solution or a how to. But I can't ...
  • 16.9k
20 votes
4 answers
37k views

Creating a wp_editor instance with custom tinyMCE buttons

Is there a way to define wp_editor() with custom tinyMCE buttons? I've noticed the wp_editor function reference mentions that one of the $settings arguments can be tinymce (array) (optional) Load ...
  • 1,227
17 votes
2 answers
5k views

How to load wp_editor via AJAX

Does anyone know how o load wp_editor via AJAX in WordPress? My markup and editor is getting loaded properly but editor controls are not getting loaded properly, it may be because Javascript is not ...
  • 171
14 votes
5 answers
7k views

How to add custom CSS (theme option) to TinyMCE?

I'm trying to add custom CSS (set via theme options) to the TinyMCE visual editor in WordPress. On the front end, the theme generates this CSS and outputs it on the wp_head hook. The problem I'm ...
13 votes
6 answers
42k views

Wordpress automatically adding "&nbsp;"?

I'm not sure if is wordpress itself or Tiny MCE that's doing it. But when switching between HTML and Visual editor it's adding &nbsp;, and adding an extra one each time I switch back and forth. I ...
  • 790
13 votes
1 answer
13k views

How to add "Insert/Edit link" button in custom popup tinymce window?

I need to insert some text in the body of the article, that turns into a "side-tag" by wrapping it inside some div tags with custom classes. I've created a custom button in tinymce that pops up a new ...
  • 373
12 votes
5 answers
11k views

Forcing reload of editor-style.css

Is there a method to force the refresh of editor-style.css, when I change manually the stylesheet for the TinyMCE editor? Modification doesn't show immediately but they will be cached in the admin ...
  • 2,585
12 votes
6 answers
20k views

Remove HTML editor and visual/HTML tabs from TinyMCE

Is it possible to remove the Visual \ HTML tabs from wp_editor and display only the TinyMCE editor? Basically, right now, I'm using wp_editor to display the smallest possible TinyMCE editor I can - ...
  • 1,227
12 votes
3 answers
37k views

How to disable TinyMCE from removing span tags

I am posting Word generated HTML to WordPress via XMLRPC. Before I go to post.php, the format is correctly preserved in the database. TinyMCE performs its magic and I lose quite a few formatting ...
  • 755
11 votes
3 answers
29k views

How to Add WYSIWYG Editor (tinyMCE) to plugin options page compatible with Wordpress 3.0 and up?

I'm trying to add tinyMCE instead of textarea for one of my options in my plugin with no luck so far. I tried this : http://www.dbuggr.com/smallwei/add-wysiwyg-editor-tinymce-wordpress-plugin/ and ...
  • 371
11 votes
1 answer
2k views

Add self-closing shortcode button to TinyMCE in WP 4.6

I'm familiar with creating self-closing shortcodes like: // shortcode function wpse_shortcode_example( $wpse_atts ) { // Attributes $wpse_atts = shortcode_atts( array( '...
  • 1,742
11 votes
1 answer
8k views

Add popup window to TinyMCE buttons

I'm looking for a good tutorial on how to create a popup window with a TinyMce button that would allow the user to select from multiple options, enter text into inputs, etc. I know how to create a ...
  • 4,816
11 votes
1 answer
3k views

Initialize TinyMCE editor / visual editor after AJAX insert

I have a "repeater" style field group on a custom options page. There's an active visual editor in a hidden state, and when the user clicks "add new" the whole row is cloned. I then need to initialize ...
10 votes
1 answer
12k views

How to customize TinyMCE4 in WP 3.9 - the old way for styles and formats doesn't work anymore

Before WP 3.9 i had the following two filters applied in the functions.php: function my_mce_buttons_2( $buttons ) { array_unshift( $buttons, 'styleselect' ); return $buttons; } add_filter('...
  • 604
10 votes
4 answers
4k views

No filter of code on switch from html to visual editor, how?

Yes, i have found other questions to this topic, but no have the same topic exactly and no solution for my problem. If you include code inside the html-tab and you switch to the visual mode, then ...
  • 16.9k
9 votes
2 answers
27k views

Add CSS Class to Link in TinyMCE editor

In searching for a solution, I've come across the plugin to enable a dropdown of CSS styles already present within a stylesheet. What I want is to allow the editor to add CSS Classes from a textbox. ...
  • 209
9 votes
2 answers
14k views

TinyMCE editor is breaking my beautiful HTML

This is pretty much an exact duplicate of: How to make Wordpress and TinyMCE accept <a> tags wrapping block-level elements as allowed in HTML5? and HTML5, WordPress and Tiny MCE issue - wrapping ...
  • 685
9 votes
2 answers
3k views

WordPress 3.9 - Trouble Editing TinyMCE 4.0

With WordPress 3.9 coming soon it's bringing along TinyMCE 4.0. I'm running my plugins and functions through some testing and found that one of my functions seems broken / not working with the new ...
  • 20.2k
9 votes
3 answers
8k views

Can you add the visual editor to the description field for custom taxonomies?

Can you add the visual editor to the description field for custom taxonomies? It would be nice to have this option available when you edit an entry for a taxonomy be it core or custom.
9 votes
1 answer
7k views

Wordpress Visual Editor Stripping HTML Changes

When I use the WordPress HTML editor to add icomoon icons like this: <span class="icon-shield"></span> and then switch to the visual editor and then back to the HTML editor, the icons ...
  • 363
9 votes
2 answers
2k views

How set defaults on wpLink()

With WP 3.2, WordPress maybe has a new function to add Link-Quicktags to the editor. But I found an function to set defaults for the link-button: Take a look at wplink.js Line 278. ...
  • 16.9k
8 votes
6 answers
35k views

How to get the input of a TinyMCE editor when using on the front-end?

I'm not sure why I haven't been able to find this, but does anyone know how to get the input of the TinyMCE editor? I am using it in the front end and want to be able to save whatever the user has ...
  • 147
8 votes
3 answers
10k views

Removing buttons from the editor

I have this nice little function to remove buttons from the tinyMCE editor in WordPress, so far I've been able to remove most of the ones I need to. function custom_disable_mce_buttons( $opt ) { $...
  • 2,269
8 votes
1 answer
2k views

Add button to TinyMCE bar without creating a plugin

I'm trying to add a custom button or two to the TinyMCE rich text editor. The tutorials I've seen so far are either outdated or explain how to do it with a custom plugin. How can I do this without ...
8 votes
2 answers
1k views

WP 3.9 TinyMCE no longer loads on category description editor

I've used this script below inside functions.php since WP 3.5 It converts the standard category description editor to a rich text editor. Unfortunately, after upgrading sites to WP 3.9, the ...
  • 3,153
8 votes
1 answer
3k views

Load wp_editor via ajax [duplicate]

Possible Duplicate: How to load wp_editor() through AJAX/jQuery I know that this has been asked before but it has not been answered fully or accurately or descriptively. I know how to load the ...
8 votes
3 answers
1k views

How to modify image editor dialog options on WordPress?

I am trying to hide the Alignment radio buttons for images uploaded to the post content area, but can't figure out how to add a custom CSS or JS file to the Image Editor dialog. I've successfully ...
7 votes
3 answers
15k views

Using TinyMce with textareas in meta boxes on custom post types

I am trying to use the http://www.tinymce.com/ plugin to add a tinymce to my textareas in my meta boxes I have created. I've googled other ways and either I cant get it to work or didnt grasp the ...
  • 193
7 votes
3 answers
11k views

How to include own css on wordpress tinymce editor?

I have added some text on tinymce editor on load. (Every time you click on Add new the tinymce editor load with this text.) but problem is how to enable css class which are using in default text. ...
7 votes
1 answer
4k views

Using wp_editor in shortcode

I am building a plugin for frontend submission. I am using shortcodes API to display the form for content submission, but I am having troubles. The problem is, wp_editor echoe's data, and shortcode ...
7 votes
6 answers
15k views

How to force TinyMCE in WordPress to replace newlines with <br> tags and not with <p>&nbsp;</p>

TinyMCE editor inserts <p>&nbsp;</p> instead of <br> tags when I press enter in my text for a new line. How to force TinyMCE in WP to replace newlines with <br> and not &...
  • 1,972
7 votes
3 answers
6k views

Hide "Add media", HTML editor from TinyMCE

I have a custom post type which supports editor. (WordPress version 3.5) I want to customize the editor for it. Make it readonly Hide "Add Media" button Hide HTML editor Remove status bar showing ...
  • 945
7 votes
1 answer
9k views

Enqueue Script After TinyMCE initialized

I am making a small live preview area inside a meta box using jquery where i need to get content from tinymce editor. But it seem my script loads before tinymce, this returns null when i try to get ...
  • 7,715
7 votes
4 answers
6k views

How to use tinyMCE for user "biographical info"?

I would like to provide our WP users (authors) with a tinyMCE editor instead of standard textarea for their "Biographical Info" on the Profile page. I have spent a lot of time searching online for ...
  • 3,386
7 votes
3 answers
18k views

How do i use fontawesome icons in TinyMce editor?

I'm trying to add a youtube button in TinyMce editor. here is a recent-posts.js file which is in the js folder of the theme directory. (function() { tinymce.create('tinymce.plugins.buttons', { ...
7 votes
5 answers
20k views

tinymce is not defined when not using wp_editor

I am using jQuery tinyMCE to populate dynamically generated text areas with tiny MCE editors. When I use the WordPress wp_editor function before I call the jQuery version, I have no issues. If I do ...
  • 746
7 votes
2 answers
4k views

Using Wordpress' WYSIWYG for comments

I've been trying to set up the comments section of a site I am working on to use the default Wordpress WYSIWYG (TinyMCE). But it's harder than expected. I used this tutorial to take me almost all the ...
7 votes
3 answers
7k views

How to add multiple buttons to TinyMCE?

I've followed a tutorial on Nettuts on how to add a custom button to TinyMCE (http://net.tutsplus.com/tutorials/wordpress/wordpress-shortcodes-the-right-way/) It works great and all, but i want to ...
  • 105
7 votes
2 answers
2k views

Why did multiple line breaks stop working in text editor?

# Adds ability to add break tags on posts remove_filter( 'the_content', 'wpautop' ); remove_filter( 'the_excerpt', 'wpautop' ); add_filter( 'the_content', 'nl2br' ); add_filter( 'the_excerpt', 'nl2br'...
  • 561
6 votes
2 answers
9k views

TinyMCE 4.x : How to customize toolbar on wp_editor()

Since upgrading to Wordpress 3.9 (which includes TinyMCE 4.x), I have problems customizing the editor, displayed via wp_editor() In the example below, I want to disable the 'fullscreen' button, but ...
  • 463
6 votes
2 answers
6k views

Unable to add "code" button to TinyMCE toolbar

This is driving me crazy. Using code from the WP codex, I can add SOME buttons to the TinyMCE bar, but NOT others. For example this code: function my_mce_buttons_2($buttons) { /** * Add ...
  • 923
6 votes
2 answers
18k views

TinyMCE Advanced newline problem

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;</...
  • 247
6 votes
2 answers
3k views

How to provide translations for a WordPress TinyMCE plugin?

I know that I can get my translations into JavaScript doing: $MyTranslations = array( 'translation1' => __("Some String 1", "MyTranslations"), 'translation2' => __("Some ...
  • 12k

1
2 3 4 5
14