Support

Account

Home Forums Add-ons Options Page Options Page Wysiwyg problem Reply To: Options Page Wysiwyg problem

  • I spent some time trying to figure a similar issue out this evening. In my case, I saw the error “switchEditors is not defined” on the Edit Media page and wanted to figure out why. I’m running WP 3.8 and ACF 4.3.4.

    From the code it looks like ACF always inserts a WYSIWYG editor in the footer of any post page, including Media. Not sure why this needs to happen, but it’s added in acf_field_wysiwyg::input_admin_head, which appears to run with the ‘acf/input/admin_head’ action…regardless of whether or not a wysiwyg field is used on that page…and actually it appears regardless of whether or not there are any ACF elements that page. Not sure why this needs to be there…?

    Anyhow, there is inline onclick JS on the #acf_settings-tmce element which is the cause of the problem. When my user-settings in the options table specify the “html” editor then input.js fires off a click event to this element. The edit Media page doesn’t have switchEditors defined though, hence the error. When my user settings are for the “tinymce” editor, no error occurs, because input.js will not attempt to click the element. Otherwise, the only way to avoid this error is to deactivate ACF entirely.

    I hope this helps!
    Harold