66 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

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.

141 posts
  • Exclusive Author
  • Has been a member for 1-2 years
  • Referred between 1 and 9 users
  • Sold between 100 and 1 000 dollars
XeePress says

Thanks for sharing your tip!

1 post
  • Bought between 10 and 49 items
  • Has been a member for 3-4 years
  • United Kingdom
chopper1972 says

Which file does that go into?

thanks!

56 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 0-1 years
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.

3449 posts Ruben Bristian
  • Most Wanted Bounty Winner
  • Elite Author
  • Sold between 250 000 and 1 000 000 dollars
  • Has been a member for 6-7 years
  • Repeatedly Helped protect Envato Marketplaces against copyright violations
  • Won a Competition
  • Bought between 100 and 499 items
  • Exclusive Author
  • Referred between 500 and 999 users
+5 more
KrownThemes says

Use global $wp_version; instead..

56 posts
  • Bought between 10 and 49 items
  • Exclusive Author
  • Has been a member for 0-1 years
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.

75 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

35 posts
  • Exclusive Author
  • Bought between 1 and 9 items
  • Has been a member for 0-1 years
  • Referred between 1 and 9 users
  • Sold between 5 000 and 10 000 dollars
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.

141 posts Designer & Developer
  • Elite Author
  • Has been a member for 5-6 years
  • Exclusive Author
  • Sold between 100 000 and 250 000 dollars
  • Referred between 50 and 99 users
  • Bought between 100 and 499 items
  • Author had a File in an Envato Bundle
  • Most Wanted Bounty Winner
  • Envato Studio (Microlancer) Beta Tester
Webbu says

Try this one;

if ( floatval(get_bloginfo('version')) >= 3.9){
//new codes
}else{
//old codes
}
373 posts
  • Bought between 100 and 499 items
  • Exclusive Author
  • Has been a member for 5-6 years
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