1111 posts
  • Most Wanted Bounty Winner
  • Envato Studio (Microlancer) Beta Tester
  • Author had a Free File of the Month
  • Bought between 50 and 99 items
  • Referred between 50 and 99 users
  • Europe
  • Has been a member for 4-5 years
  • Exclusive Author
  • Sold between 10 000 and 50 000 dollars
Smartik says

Use global $wp_version; instead..
Try to use globals as little as possible. Use them when you really need them. Here you have no reasons why you should one or another, use any of them, but I would choose the function.

Anyways, this snipet is not perfect and it will return true on if both are numbers(integers or floats) but what if the WP version is a alpha release or RC or whatever? Here must be used native php version_compare() because it know how version naming works.

$version = get_bloginfo('version');
if( version_compare( $version, 3.9, '<' ) ) {
   //do the magic here
}
67 posts
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Author had a File in a Mini Bundle
  • Author had a File in an Envato Bundle
  • Most Wanted Bounty Winner
  • Exclusive Author
  • Author had a Free File of the Month
  • Envato Studio (Microlancer) Beta Tester
+3 more
smartdatasoft says

@Smartik , @RubenBristian

thank you very much. Actually i was in hurry to update that.

global $wp_version;

is best practice. and also version_compare :)

76 posts Vibe
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Exclusive Author
  • Has been a member for 3-4 years
  • Referred between 10 and 49 users
  • Bought between 10 and 49 items
VibeThemes says


WP 3.9 is one of the most unstable updates by WordPress so far. It has also meant death for many plugins using TinyMCE. Popular plugins such as Ultimate TinyMCE (over 2 million downloads) have declared end of life.
WooCommerce have already said they are not going to update. refer link.
, the compat3x does not work (link), The WP codex isn’t updated refer link ..I wonder why was there such haste to release it, when it was already known that upgrading TinyMCE to 4.0 would have issues and considering the impact of this on # of websites

LOL. You’re quite the drama queen aren’t you?

First off, I know change is hard. However, v3.9 isn’t as unstable as you claim. The release date was well known in advance. There were months where you could have tested more / provided more input during the betas and RCs. If you failed to get sufficiently involved then don’t blame the WP team.

Apparently, you’re unaware of the fact that Ultimate TinyMCE has only been Eol ‘ed because it’s been replaced with this (so not really dead) ...

https://wordpress.org/plugins/wp-edit/

WooCommerce is the brand rather the company. Woothemes will continue to update WooCommerce and the built in WC ShortCode will still work (no site breakage).

However, the ShortCode generator may just be MIA for a while. I know this can be fixed because it was already fixed on another plugin. It’s a TinyMCE issue rather than a WP one anyhow. If you’d done any amount of decent testing before release, you’d probably have already fixed it by now.

So, the sky is not falling and it’s really just your own stuff need fixing. They’re only dead if you decide to abandon them in their current state.
Well, the previous response was out of frustration of not finding results on debugging the issues after almost 12 hours, we had long known that TinyMCE 4.0 will bring issues. If you simply browse around you’ll find that there are many many people facing similar issues and all the blame will be given to the Plugin/theme authors and developers. Worst part is that TinyMCE 4.0 is not backwards compatible, several functions have simply been renamed/changed without a fallback.
374 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 5-6 years
WPWiseOwl says

Well, the previous response was out of frustration of not finding results on debugging the issues after almost 12 hours, we had long known that TinyMCE 4.0 will bring issues. If you simply browse around you’ll find that there are many many people facing similar issues and all the blame will be given to the Plugin/theme authors and developers. Worst part is that TinyMCE 4.0 is not backwards compatible, several functions have simply been renamed/changed without a fallback.

I see. Venting of frustration is fine. Spreading misinformation, not so much. I felt the need to try to prevent any potential spread of misinformation here. I have no need to browse around as I’ve been directly involved in several such situations personally. However, I feel that is just the way of things. Plugin / Theme authors like us know what TinyMCE is but end users don’t typically.

Let them remain ignorant about such things, that’s one reason they pay us. That’s also why I purchase from others as I’m still ignorant of so much. There’s always someone smarter. Though if any author has procrastinated (or supposedly didn’t have the time to go) about fixing any such issues until the 3.9 RC2 / Final was out, I have little to no sympathy. That’s just bad form IMO. Good Luck! ;-)

58 posts
  • Exclusive Author
  • Bought between 10 and 49 items
  • Has been a member for 1-2 years
thememassive says

I see. Venting of frustration is fine. Spreading misinformation, not so much. I felt the need to try to prevent any potential spread of misinformation here. I have no need to browse around as I’ve been directly involved in several such situations personally. However, I feel that is just the way of things. Plugin / Theme authors like us know what TinyMCE is but end users don’t typically.

Let them remain ignorant about such things, that’s one reason they pay us. That’s also why I purchase from others as I’m still ignorant of so much. There’s always someone smarter. Though if any author has procrastinated (or supposedly didn’t have the time to go) about fixing any such issues until the 3.9 RC2 / Final was out, I have little to no sympathy. That’s just bad form IMO. Good Luck! ;-)
You are indeed very wise sir! Totally agree with you :)
1621 posts Building the Web.
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Exclusive Author
  • Author had a File in an Envato Bundle
  • Most Wanted Bounty Winner
  • Bought between 50 and 99 items
  • Has been a member for 4-5 years
+2 more
ZoomIt says

Javascript version for both pre 3.9 and 3.9

Hope it’s good

if (typeof window.tinyMCE != 'undefined') {
                    if (typeof window.tinyMCE.activeEditor != 'undefined') {
                        window.tinyMCE.activeEditor.selection.moveToBookmark(window.tinymce_cursor);
                    }
                    if (typeof window.tinyMCE.execInstanceCommand != 'undefined') {
                        window.tinyMCE.execInstanceCommand('content', 'mceInsertContent', false, arg);
                    } else {

                        if (typeof window.tinyMCE.execCommand != 'undefined') {
                            window.tinyMCE.get('content').execCommand('mceInsertContent', false, arg);
                        }
                    }
                }

tested with 3.6 and 3.9 and it worked for me…

154 posts ThemeVan
  • Elite Author
  • Sold between 100 000 and 250 000 dollars
  • Bought between 1 and 9 items
  • Exclusive Author
  • Has been a member for 4-5 years
  • Most Wanted Bounty Winner
  • Referred between 100 and 199 users
ThemeVan says

Thanks soooo much!!

by
by
by
by
by
by