#55054 closed defect (bug) (invalid)
Call to wp_editor() produces fatal error - tinymce not found or invalid
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | major | Version: | 5.9 |
| Component: | TinyMCE | Keywords: | |
| Focuses: | ui, administration | Cc: |
Description
I have created some plugins which customize the toolbar for the editor when used as the textarea for certain form fields. Here is an example of the lines of code which will produce a fatal error:
$args = array(
'tinymce' => array(
'toolbar1' => 'bold,italic,bullist,link,unlink',
)
);
wp_editor( $editor_content, $editor_id, $args );
Error in logs:
PHP Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function "tinymce" not found or invalid function name in /nas/content/live/dev/wp-includes/class-wp-hook.php:307
Stack trace:\n#0 /nas/content/live/dev/wp-includes/plugin.php(189): WP_Hook->apply_filters('html', Array)\n#1 /nas/content/live/dev/wp-includes/general-template.php(3519): apply_filters('wp_default_edit...', 'html')\n#2 /nas/content/live/dev/wp-includes/class-wp-editor.php(183): wp_default_editor()\n#3 /nas/content/live/dev/wp-includes/general-template.php(3547): _WP_Editors::editor('Abstract and bi...', 'content', Array)\n#4 /nas/content/live/dev/wp-admin/edit-form-advanced.php(604): wp_editor('Abstract and bi...', 'content', Array)\n#5 /nas/content/live/dev/wp-admin/post.php(206): require('/nas/content/li...')\n#6 {main}\n thrown in /nas/content/live/dev/wp-includes/class-wp-hook.php on line 307
These errors did occur in version 5.8.
Hi there, welcome to WordPress Trac! Thanks for the report.
This looks a bit confusing to me, as the error message mentions a function named
tinymce(), but there is no such function in the provided example. Based on the ticket status, it seems like the issue is resolved now?