[wp-trac] [WordPress Trac] #42716: When using the wp_editor_settings filter and setting tinymce to false, the Word Count feature breaks.

WordPress Trac noreply at wordpress.org
Mon Nov 27 21:01:05 UTC 2017


#42716: When using the wp_editor_settings filter and setting tinymce to false, the
Word Count feature breaks.
--------------------------+-----------------------------
 Reporter:  conner_bw     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:  4.9
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 As a Plugin Developer WordPress has a filter named `wp_editor_settings`
 and I use it. This filter allows me to set `tinymce` to false:


 {{{
 add_filter( 'wp_editor_settings', function ( $settings ) {
         $settings['tinymce'] = false;
         return $settings;
 });

 }}}


 When I do this the Word Counter breaks. The reason this happens is because
 [https://github.com/WordPress/wordpress-
 develop/blob/a825a181e11b1a89e76d79d22bd2c220f45b3741/src/wp-
 admin/js/post.js#L1216 the code is tightly coupled with this JS function].

 '''Expected:''' `<td id="wp-word-count" class="hide-if-no-js">` is hidden,
 or the description is changed to something like "Last Known Word Count"
 ''(terrible, please come up with better words...)''

 '''Actual:''' Word Counter initialized at start of post, not updated until
 page refresh.

 Thank you for your consideration.

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


More information about the wp-trac mailing list