Wednesday, March 10, 2010


Search for: 
Subscribe to my full RSS feed Follow me on Twitter

TinyMCE Advanced Editor And MarkItUp

October 27, 2009 by Bill Hamilton  
Filed under Other Rambling Thoughts

I love the TinyMCE Advanced Editor plugin for the WordPress Admin functions with posts and pages. So, I was dismayed when I lost its cool functionality recently. I went so far as to deactivate all my plugins, but I still could not get the toolbars to appear in the edit pages again. Today, I took the time to track down the issue (which I did not find by Google searches).

I installed a fresh WordPress 2.8.5 and copied all my plugins to it. I then activated TinyMCE first and, yes, my toolbars were there! I then activated other plugins one-by-one until the toolbars no longer appeared. The last plugin I activated before losing the TinyMCE functionality was WP-MarkItUp. I had originally thought that WP-MarkItUp would allow visitors to style their comments a bit more by providing new features to the textarea in which comments are entered. What I didn't realize at the time was that it also applies to the textarea of the post and page editors as well; there is no exemption for the admin area.

I deactivated WP-MarkItUp, but TinyMCE's functionality did not return. I then deactivated and re-activated TinyMCE, but alas I still did not have it's functionality back. I then looked into the PHP pages of WP-MarkItUp for a clue on what it was doing at the time it was activated. I found that it updates the user option for "rich_editing" to 'false'. The user options are stored in the usermeta table (i.e. wp_usermeta if your table prefix is wp_), so I selected all columns for the row whose meta_key was 'rich_editing' and user_id was mine (2 in my case). Sure enough, its value was 'false'.

After activating WP-MarkItUp, my user option for 'rich_editing' was set to 'false'.

I updated the value to 'true' and eureka! I have TinyMCE back.

After resetting the 'rich_editing' value to 'true', I have TinyMCE back.

Who's At Fault?

I thought about what it took to chase this down and fix it. Was it the fault of WP-MarkItUp not resetting the value when it was deactivated? What about the fact that TinyMCE did not set the value to true when I deactivated, then reactivated it?

I can't blame either plugin or developer. Once activated, WP-MarkItUp would have to persist the former state of rich_editing to know what to set it back to. But, how could it be certain that no other plugin had not manipulated it after it was activated? Setting it back could cause another plugin to fail just as not setting it back caused TinyMCE to fail. I'm not certain why TinyMCE did not change the value after re-activation, but if it didn't need the value in the first place, then why did it not resume display when WP-MarkItUp was deactivated? That I can't answer, but perhaps in the future it could check to see if 'rich_editing' is 'true' if it is necessary for the proper functioning of the plugin. For now, having the functionality of TinyMCE back is good enough for me, but as a bonus, I learned something new about how WordPress uses the user options! A two'fer!

http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/digg_48.png http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/reddit_48.png http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/dzone_48.png http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/stumbleupon_48.png http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/delicious_48.png http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/blinklist_48.png http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/blogmarks_48.png http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/furl_48.png http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/newsvine_48.png http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/technorati_48.png http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/magnolia_48.png http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/google_48.png http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/myspace_48.png http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/facebook_48.png http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/yahoobuzz_48.png http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/twitter_48.png http://billhamilton.com/wp/wp-content/plugins/sociofluid/images/meneame_48.png

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!