[wp-trac] [WordPress Trac] #29130: wp.mce.View.extend no longer working as expected

WordPress Trac noreply at wordpress.org
Wed Aug 6 11:49:47 UTC 2014


#29130: wp.mce.View.extend no longer working as expected
--------------------------+-----------------------------
 Reporter:  tolnem        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  TinyMCE       |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:  javascript    |
--------------------------+-----------------------------
 I have a plugin that uses `wp.mce.views.register` to parse shortcodes and
 render a placeholder in the wysiwyg editor.

 In 3.9.1, I was using the syntax `View: wp.mce.View.extend({...})` to
 create the view that is rendered in the editor, but this no longer works
 under 4.0. The default wp.mce.View object is used instead.

 In 4.0 beta, I I instead need to use `View: _.extend( {}, wp.mce.View,
 {...})` to get the same effect that I used to get using
 wp.mce.View.extend. The underscore based syntax is however not backwards
 compatible with 3.9.1, where it breaks with the javascript error "g.View
 is not a constructor".

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


More information about the wp-trac mailing list