[wp-trac] [WordPress Trac] #55120: "wp_editor_settings" filter not working for the Classic block TinyMCE settings

WordPress Trac noreply at wordpress.org
Tue Feb 8 21:49:55 UTC 2022


#55120: "wp_editor_settings" filter not working for the Classic block TinyMCE
settings
--------------------------+-----------------------------
 Reporter:  oztaser       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  TinyMCE       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 This filter was added in the #45348 to Classic Block but I think it's not
 working. To run this filter we need to use return value of `array_merge`
 [https://github.com/WordPress/wordpress-develop/blob/trunk/src/wp-includes
 /script-loader.php#L517/ reference]. I double check if there is an any
 version of PHP could support this usage but I couldn't found:
 https://3v4l.org/v4YBT

 You can find below my must use plugin for test, it doesn't effect any
 option of Classic block.
 {{{#!php
 <?php
 namespace NefisYemekTarifleri\Test_Classic_TinyMCE_Settings;

 add_filter( 'wp_editor_settings', __NAMESPACE__ . '\\editor_settings', 10,
 2 );
 function editor_settings( $settings, $editor ) {
         if ( 'classic-block' !== $editor ) {
                 return $settings;
         }

         $settings['tinymce'] = [
                 'toolbar1' => 'bold,italic'
         ];

         return $settings;
 }
 }}}

 I hope I don't miss anything 🙂

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55120>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list