From fd1782df79c5b514bfc58d2427e68d0c1c3eeddb Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Fri, 9 Jun 2023 14:53:02 +0300 Subject: [PATCH] - probably fix #1199; --- includes/admin/core/class-admin-forms.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/includes/admin/core/class-admin-forms.php b/includes/admin/core/class-admin-forms.php index 8ffc9424..e4fa63fb 100644 --- a/includes/admin/core/class-admin-forms.php +++ b/includes/admin/core/class-admin-forms.php @@ -882,8 +882,11 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) { $value = $this->get_field_value( $field_data ); + add_filter( 'wp_default_editor', array( &$this, 'set_default_editor_fix' ) ); + ob_start(); - wp_editor( $value, + wp_editor( + $value, $id, array( 'textarea_name' => $name, @@ -891,14 +894,25 @@ if ( ! class_exists( 'um\admin\core\Admin_Forms' ) ) { 'editor_height' => 425, 'wpautop' => false, 'media_buttons' => false, - 'editor_class' => $class + 'editor_class' => $class, ) ); $html = ob_get_clean(); + + remove_filter( 'wp_default_editor', array( &$this, 'set_default_editor_fix' ) ); + return $html; } + /** + * Fix the displaying wp_editor on macOS + * + * @return string + */ + public function set_default_editor_fix() { + return 'html'; + } /** * @param $field_data