68 posts
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+8 more
smartdatasoft says

Hello,

All the author and client may face issue after wordrpess 3.9 update. There TinyMCE short code popup may not work.

This happen due to there api change in 4.0. I have googled some days ago , but there is no good solution . After lots of research i am able to solve that.

So i think it will save some time for all.

1. I have checked the version so that my code work on <3.9 if some use 3.8

<?php
$version = get_bloginfo('version'); 
?>

2. after that bellow code is to insert your pop up code to editor.

              <?php if($version<3.9 ):?>

            window.tinyMCE.execInstanceCommand

(window.tinyMCE.activeEditor.editorId, 'mceInsertContent', false, 

out);

            window.tinyMCE.activeEditor.execCommand('mceRepaint');

            tinyMCEPopup.close();

<?php else : ?>

            parent.tinyMCE.execCommand('mceInsertContent', 

false,out);
            parent.tinyMCE.activeEditor.windowManager.close();

<?php endif; ?>

    <?php if($version<3.9) :?>

        <input type="submit" value="Add" 

onclick="returnShortcodeValue()" id="insert" /> 
        <input type="button" value="Close" 

onclick="tinyMCEPopup.close()" id="cancel" />

<?php else : ?>
        <input type="submit" value="Add" 

onclick="returnShortcodeValue()" id="insert" />
        <input type="button" value="Close" 

onclick="parent.tinyMCE.activeEditor.windowManager.close()" 

id="cancel" />
<?php endif ; ?>

N.B: Please keep in mind it may same for you or your code may use different way. I just post what is work for me.

151 posts
  • Has been part of the Envato Community for over 1 year
  • Has referred 1+ members
  • Has sold $100+ on Envato Market
  • Sells items exclusively on Envato Market
XeePress says

Thanks for sharing your tip!

1 post
  • Has been part of the Envato Community for over 3 years
  • Has collected 10+ items on Envato Market
  • Located in United Kingdom
chopper1972 says

Which file does that go into?

thanks!

60 posts
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 1 year
thememassive says

Thank you for sharing. Using your code, I was able to fix my Popup window code which was not working in the new version.

However, I’m currently doing some testing with previous versions and I found that for versions such as 3.8.3, 3.8.2 (and other versions with 2 decimal points), this will break. As the JavaScript Comparison operator: ‘less than’ (<) doesn’t recognize these version numbers as they are technically not valid numbers… because they have 2 decimal points.

Anyway, I just found out this problem and I’m trying to find an efficient solution to this. Please share if someone knows the solution. Don’t think it would be too difficult.

Thanks again and regards.

3538 posts Ruben Bristian
  • Sells items exclusively on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $500,000+ on Envato Market
  • Has been part of the Envato Community for over 6 years
+10 more
KrownThemes says

Use global $wp_version; instead..

60 posts
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 1 year
thememassive says

I ended up using version_compare function of Php. Here is a more detailed tutorial on how to use it to compare the Wordpress version.

78 posts Vibe
  • Has referred 10+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+2 more
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

36 posts
  • Has referred 1+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
RepublikWP says

1. I have checked the version so that my code work on <3.9 if some use 3.8
<?php
$version = get_bloginfo('version'); 
?>

Thank you.

143 posts Designer & Developer
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has sold $125,000+ on Envato Market
  • Sells items exclusively on Envato Market
+5 more
Webbu says

Try this one;

if ( floatval(get_bloginfo('version')) >= 3.9){
//new codes
}else{
//old codes
}
374 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 100+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in United States
WPWiseOwl 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.

by
by
by
by
by
by