This is a strange problem as it used to work, but for some reason the wysiwyg editor is only showing HTML on the options page (i have a few options pages registered). It is all fine on the other pages. I have tried turning off all other plugins but still no joy!
These are the errors from the console:
Error: ReferenceError: switchEditors is not defined
Error: TypeError; tinyMCE.settings is undefined
So looks like it is a tinyMCE problem, just not sure where to go from here, please help!
I just tested this myself with WP 3.8, ACF 3.4.4 and can confirm that the WYSIWYG field is correctly working on an options page.
Perhaps there is some theme code / plugin conflict?
Can you try on a fresh install of WP and add in plugins / themes until you hit the issue?
I haven’t managed to fix it either, tried disabling all other plugins and even switching themes but it doesn’t work still, only on the options page, I do have a similar set up on another site (only one options page registered though, although different hosting setup) and it works there. I have almost resigned myself that it must be a jquery problem in my template, or some kind of permissions problem, but haven’t had time to look any further.
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!
The topic ‘Options Page Wysiwyg problem’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
© 2023 Advanced Custom Fields.