TinyMCE removed on v5
-
Why is the TinyMCE code removed from v5?
v4.1.15 can produce nice TinyMCE output for the main content
v5.x has the related code removed from class-fieldtypes-textarea and only shows quick tagsin fact it calls wp_editor within ob_start(); but bizarrely omits the
$html .= ob_get_contents();
to get the result.. and then shows a text area instead..if the previous code is restored it seems to work fine…
-
Again, sorry that you ran into issues here!
I’d first want to know the same answers I asked for in this thread: https://ww.wp.xz.cn/support/topic/free-plans-issues/
It’s possible this is an omission in 5.0, but I’d want a confirmation that a conflict test doesn’t fix this somehow first.
Please let me know.
I tried this again on a fresh test environment with only the following enabled:
WordPress 4.9.1
Business Directory 5.1.2 (unmodified)this give the ugly quick tags only.
If I modify Business Directory 5.1.2 to restore the class-fieldtypes-textarea functionality from v4.1.15 then the rich editor appears rather than the quick tags, and this is improved further if TinyMCE Advanced 4.6.7 is enabled.
This is not a conflict, it is what can be expected from a quick view of the source code in v5.1.2 where the output of wp_editor() is not captured.
OK, we’ll take a look at what got left out in 5.0 and try to sneak it in for the next patch release.
Hi,
We’ve been investigating this and it seems like TinyMCE is installed with v5.0 as we’d expect, so we’d like to understand exactly what you see. Here’s what my developer said:
I don’t see a big difference between the 4.1.x version and the 5.x version of the editor. Could you please ask the customer to give us more details about what he sees? Screenshots would be greatly appreciated.
It sounds like our editor no longer supports extensions or features added by third party plugins, but I would like to confirm first.
Please let me know.
Hi, when I raised this issue I referred you to the line in the source code,
Specifically the version 5 code in class-fieldtypes-textarea seemed to be missing the line:$html .= ob_get_contents();
which would get the result of the standard editor, instead it ignores the editor returned by WordPress and it goes off and does its own thing instead.
restoring the v4.1.15 code for this section works fine
I hear what you are saying. However, we did try that and didn’t get exactly what you’re describing.
Here’s what my developer said about it:
While that modification works on some scenarios, it is not a complete solution. Could you please ask the customer to give us more details about what he sees? Screenshots would be greatly appreciated.
It sounds like our editor no longer supports extensions or features added by third party plugins, but I would like to confirm first.
I installed the TinyMCE Advanced plugin that the customer mentioned in the forum, but it is still not obvious to me what are the missing features that our implementation of the editor has:
Edit Post (standard admin screen):
https://user-images.githubusercontent.com/45068/34397696-548475aa-eb46-11e7-9cc3-48b473b12d12.png
Submit Listing:
https://user-images.githubusercontent.com/45068/34397702-5feb6aa2-eb46-11e7-9c68-d3ac8be2c50d.png
There are still CSS/layout issues, but I see all the menu options.
We need to know more about the customer’s specific problem (see #3337 (comment)) so that we can try to create a solution that works on his website and in the other scenarios we need to support.
5.1.5 seems to have the same problem in class-fieldtypes-textarea.php function render_field_inner()
the line:
$html .= ob_get_contents();
is missing before
ob_end_clean();
and a substitute html is created that won’t respect the tinymce optionsIf
$html .= ob_get_contents();
is added, and the next 2 $html .= lines after ob_end_clean(); are commented out then the previous behaviour is restored.ie:
v5 behaviour gives this:
https://jonmoblog.files.wordpress.com/2018/01/v5-1-behaviour.jpgprevious behaviour, restored after this correction, gives this:
https://jonmoblog.files.wordpress.com/2018/01/bus-directory-previous-behaviour.jpgI don’t really understand what the reason for this code change is, I’m just restoring the previous v4 code here..
This is resolved in version 5.1.6 that just went out today.
Try that and let me know if you run into more issues.
Yes that does it thanks.
The topic ‘TinyMCE removed on v5’ is closed to new replies.