Remove and replace TinyMCE from edit screen

Question

I need to remove the tinymce editor from the edit page of a certain custom post type to replace it with a custom leaflet map. I’m using a snippet I’ve found on this site, but it will not work, I get this error: Fatal error: Uncaught ArgumentCountError: Too few arguments to function StoreLocator::custom_editor_ui()

public function custom_editor_ui( $settings, $editor_id )
  {
    if( $editor_id === 'content' && get_current_screen()->post_type === 'custom_post_type' ){
      $settings['tinymce'] = false;
      $settings['quicktags'] = false;
      $settings['media_buttons'] = false;
    }
    return $settings;
  }

in my init static function of the plugin I’m using this filter:

add_filter( 'wp_editor_settings', array(__CLASS__, 'custom_editor_ui') );

How I can achieve this and fix the error?

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/remove-and-replace-tinymce-from-edit-screen/">

Remove and replace TinyMCE from edit screen</a>
0
, , , sialfa 2 months 0 Answers 17 views 0

Leave an answer