#21350 closed defect (bug) (fixed)
Fatal error: Class '_WP_Editors' not found
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 3.4.2 | Priority: | normal |
Severity: | normal | Version: | 3.4 |
Component: | TinyMCE | Keywords: | has-patch |
Focuses: | Cc: |
Description
When a theme makes use of TinyMCE on the front end and a language other than default en is chosen in wp-config.php, then WordPress 3.4.1 dies with:
Fatal error: Class '_WP_Editors' not found in /path/to/wp-includes/js/tinymce/langs/wp-langs.php on line 548.
Solution is to require the class-wp-editor.php file if not already included in function wp_mce_translation(). Patch attached.
Attachments (1)
Change History (8)
#2
@
13 years ago
- Keywords reporter-feedback removed
In common with many themes and plugins that predate wp_editor()
, the theme makes use of a customised version of wp_tiny_mce()
to enable TinyMCE on the comment textarea.
A quick search shows that, for example, BP GTM System, Rich Text Widget, MCEComments, Custom Fields, Quickpress all make use of this technique as well (not sure how many of those are current though). And searching for the string "Fatal error: Class '_WP_Editors' not found" yields 53,600 results, so I suspect that many other themes and plugins haven't transitioned to wp_editor()
for the comment textarea yet.
The patch would keep backwards compatibility with the above technique.
#3
@
13 years ago
Related: ticket:20119:2, [20601]
#5
@
13 years ago
So the problem is that some plugins and themes have copied code from core instead of using the API and then didn't update/maintain that code when the corresponding WP functions were updated.
In this case it's easy to fix by putting these two lines back ticket:20119:2, but thinking we should not support this in general.
Wondering how exactly the theme uses TinyMCE. The class is included when calling
wp_editor()
andtinymce/langs/wp-langs.php
is not used if TinyMCE was used directly as a JS. The only call towp-langs.php
is in the _WP_Editors class.