Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#55054 closed defect (bug) (invalid)

Call to wp_editor() produces fatal error - tinymce not found or invalid

Reported by: burnside's profile burnside 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.

Change History (4)

#1 @burnside
4 years ago

  • Resolution set to invalid
  • Status changed from new to closed

#2 @SergeyBiryukov
4 years ago

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?

#3 @burnside
4 years ago

Yes, this ticket is resolved. The error was not present when all plugins where deactivated. I was able to trace which plugin produced the error and have contacted the plugin's developer.

This ticket can be closed.

#4 @SergeyBiryukov
4 years ago

  • Milestone Awaiting Review deleted

Thanks for the follow-up!

Note: See TracTickets for help on using tickets.