Title: mce_thref in tinymce?
Last modified: August 18, 2016

---

# mce_thref in tinymce?

 *  Resolved [nathanielstern](https://wordpress.org/support/users/nathanielstern/)
 * (@nathanielstern)
 * [18 years, 8 months ago](https://wordpress.org/support/topic/mce_thref-in-tinymce/)
 * Have been editing a plugin where I’m trying to use a combo of lightbox and flickrphp–
   don’t know much about it, but the editing seems to be working… Anyhow, I’m putting
   links in the title attribute of a lightbox href, and it works great when I’m 
   not using the rich editor, but as soon as I save or switch to visual vs code,
   all my “href”s turn to “mce_thref”s within that code. Oddly, it does this nowhere
   else, and stops doing it if i put spaces in my code (but then the link doesn’t
   work any more!). Any remedies? Or is the rich text editor just completely out
   if I want to do this….?
 * Thanks so much!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [18 years, 8 months ago](https://wordpress.org/support/topic/mce_thref-in-tinymce/#post-630713)
 * Sounds like a TinyMCE bug. TinyMCE has weirdness sometimes with various flavors
   of Firefox. I’ll bet it works fine in IE.
 * Anyway, no certain fix yet. Generally WordPress attempts to fix these issues 
   by upgrading the whole of TinyMCE.
 *  Thread Starter [nathanielstern](https://wordpress.org/support/users/nathanielstern/)
 * (@nathanielstern)
 * [18 years, 8 months ago](https://wordpress.org/support/topic/mce_thref-in-tinymce/#post-630724)
 * erg. I’m on a Mac… So should I just upgrade TinyMCE from their site? Given that
   wordpress is only a week or so old, won’t it have the most recent version of 
   TinyMCE? Thanks again…
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [18 years, 8 months ago](https://wordpress.org/support/topic/mce_thref-in-tinymce/#post-630751)
 * > _I’m on a Mac…_
 * Okay, then are you using Firefox or Safari? Whichever it is, try the other one
   and see if it still happens.
 * And yes, WordPress is using one of the latest versions of TinyMCE, but that doesn’t
   mean that it’s bug-free. No piece of software is bug free.
 *  Thread Starter [nathanielstern](https://wordpress.org/support/users/nathanielstern/)
 * (@nathanielstern)
 * [18 years, 8 months ago](https://wordpress.org/support/topic/mce_thref-in-tinymce/#post-630753)
 * Safari works but not with TinyMCE, Firefox not all. SO, i just wrote my first
   plugin, and it seems to work. here goes, if anybody wants to use it. Just ignore
   the mce_thref – it’ll get replaced when pulling the content from the database,
   as long as the plugin is activated. Yay, me.
 *     ```
       <?php
       /*
       Plugin Name: mce-firefox-fix
       Plugin URI: http://nathanielstern.com
       Description: Plugin to fix firefox bug in tinymce and phpflickr
       Date: 2007, October, 3
       Author: nathaniel stern
       Author URI: http://www.nathanielstern.com
       Version: 0.1
       */
       /*
   
       Author: nathaniel stern
       Website: http://www.nathanielstern.com
   
       */
       add_filter('the_content','mce_firefox_fix');
   
       function mce_firefox_fix($content) {
           $regex = '/\mce_thref/i';
       	preg_match_all( $regex, $content, $matches );
       	for($x=0; $x<count($matches[0]); $x++)
       	{
       			$replace = 'href';
       		$content = str_replace($matches[0][$x], $replace, $content);
       	}
       	return $content;
       }
   
       ?>
       ```
   

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘mce_thref in tinymce?’ is closed to new replies.

## Tags

 * [editor](https://wordpress.org/support/topic-tag/editor/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [php](https://wordpress.org/support/topic-tag/php/)
 * [tinymce](https://wordpress.org/support/topic-tag/tinymce/)

 * 4 replies
 * 2 participants
 * Last reply from: [nathanielstern](https://wordpress.org/support/users/nathanielstern/)
 * Last activity: [18 years, 8 months ago](https://wordpress.org/support/topic/mce_thref-in-tinymce/#post-630753)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
