0

Yes I know it's 2016 and IE8 is older that my grandma but I have to support it for specific reasons.

My TinyMCE is not loading, it is version 4.4.1 in Wordpress 4.6.1 and when loading the Add new post screen in IE8 I get Could not set the href property. Invalid property value in tinymce.min.js and also this.getDoc().body is null or not an object

Is there a way of deregistering this script and enqueueing and older version?

Thanks

I have since discovered that TinyMCE loads fine is script_debug is false as default, but I need this to be true for my ACF color pickers to work so I have added the following to my themes functions.js

add_action('admin_init', 'unload_all_jquery');
function unload_all_jquery() {
    $jquery_ui = array(
        "iris",
    "wp-color-picker"
    );

    foreach($jquery_ui as $script){
        wp_dequeue_script($script);
    }
}

      add_action( 'admin_enqueue_scripts', 'load_admin_style' );
      function load_admin_style() {
        wp_enqueue_style( 'irisacf', get_template_directory_uri() . '/css/irisacf.css', false, '1.0.0' );
    wp_enqueue_script('irisnew','http://SITEURL/wp-admin/js/iris.min.js?ver=1.0.7');
    wp_enqueue_script('colornew','http://SITEURL/wp-admin/js/color-picker.js?ver=4.6.1');
       }

And this is loading the files i've enqueued but is not removing iris and wp-color-picker from the scripts it's loading, in the source it has this line:

<script type='text/javascript' src='http://SITEURL/wp-admin/load-scripts.php?c=1&amp;load%5B%5D=hoverIntent,common,admin-bar,svg-painter,heartbeat,wp-auth-check,jquery-ui-widget,jquery-ui-tabs,jquery-ui-mouse,jquery-ui-sorta&amp;load%5B%5D=ble,jquery-ui-draggable,jquery-ui-slider,jquery-touch-punch,iris,wp-color-picker,thickbox,underscore,shortcode,media-upload,back&amp;load%5B%5D=bone,wp-util,wp-backbone,media-models,wp-plupload,mediaelement,wp-mediaelement,media-views,media-editor,media-audiovideo,mce-vie&amp;load%5B%5D=w,imgareaselect,image-edit,editor,quicktags,wp-a11y,wplink,jquery-ui-position,jquery-ui-menu,jquery-ui-autocomplete,wp-embed&amp;ver=4.6.1'></script>
  • but does it work on netscape4? ;) It is probably not supported anymore by microsoft so your quest is probably hopeless – Mark Kaplun Oct 21 '16 at 13:03
  • .... older scripts might not work with new versions of wordpress. You can try download an old version of wordpress – Mark Kaplun Oct 21 '16 at 13:05
  • OK I have just discovered that it works if I set script_debug to false, but I need it set to true for my color picker fields to work in IE8. If set to false, TinyMCE loads fine but my color picker fields then don't load. – Adrian Oct 21 '16 at 13:10
  • @NabilKadimi yes so it is compatible, and just discovered that it does work but when scripts_debug is true (so that other things work for me which didn't before) then it no longer works... – Adrian Oct 21 '16 at 13:23
1

The hook admin_init is to early for dequeuing, use wp_print_scripts, see examples in the Codex.

define( 'SCRIPT_DEBUG', true ); will prevent combining dashboard scripts, so if that works for you on IE8, then do it for users with IE8:

/**
 * True if user browser is IE8.
 */
$is_IE8 = preg_match( '/(?i)msie 8/', $_SERVER['HTTP_USER_AGENT'] );

/*
 * Disable combining dashboard scripts for people using IE8. 
 */
if( $is_IE8 ) {
    define( 'SCRIPT_DEBUG', true);
}
  • Thanks Nabil, that's a handy snippet, unfortunately like I said enabling script_debug fixes my color picker field issue but then the TinyMCE doesn't work, disabling script_debug fixes TinyMCE but then breaks the color pickers... – Adrian Oct 21 '16 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.