Home › Forums › Add-ons › Options Page › Options Page Wysiwyg problem
Hi Elliot
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
(sourcefile: http://xxxxxx/wp-content/plugins/advanced-custom-fields/js/input,min.js?ver=4.3.4)
So looks like it is a tinyMCE problem, just not sure where to go from here, please help!
Hi @SimonPrice
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?
Thanks
E
Hi I have the same issue, anyone find a solution for this? I have tried updating WordPress to 8.0, and ACF, but no dice. all I see in the options section in my backend is a text box with html code no controlls.
Any hints would be a great help
Thanks Elliot,
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.
Hi @SimonPrice
If you want, I can login and take a look for you. Just leave some login details bellow and I’ll see what I can find.
Thanks
E
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
Hi Elliot
Did you get a chance to log in and check this out?
Thanks for your help
Simon
Hi @SimonPrice
Sorry mate, I haven’t been able to look at this one just yet. It’s been a very busy week and everything has been put on hold.
I’ll take a look shortly, thanks
Cheers
E
Hi @SimonPrice
Just logged in and can see the issue is coming from some custom JS on the page. Here is a screenshot which shows the error:
Hi @SimonPrice
You will need to track down where this inline JS code is comming from and either remove it or wrap it in a:
jQuery(window).load(function(){
});
Thanks
E
Hi Elliot, thanks for your replies, annoyingly I hadn’t seen them as I didn’t receive an email, thanks for logging in, its now fixed.
Simon
I guess the problem I referred to was completely different then. All the code that caused the JS error was from the ACF plugin itself.
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.