[wp-trac] [WordPress Trac] #34716: Using wplink (wp_editor) on front end is triggering a js error due to unsatisfied dependency

WordPress Trac noreply at wordpress.org
Tue Nov 17 17:37:48 UTC 2015


#34716: Using wplink (wp_editor) on front end is triggering a js error due to
unsatisfied dependency
--------------------------+-----------------------------
 Reporter:  imath         |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Editor        |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:  javascript    |
--------------------------+-----------------------------
 wplink should include `jquery-ui-core` in its dependencies as it uses it >
 `$.ui`

 When using the wp_editor in front end, if you click on the link button,
 and once the window is opened, if you try to type some text for the link's
 text, you get :
 `Uncaught TypeError: Cannot read property 'keyCode' of undefined`

 I think that's because `$.ui` is not defined, because the `jquery-ui-core`
 is not enqueued on front-end (it's enqueued in the post edit
 Administration screen).

 Using the attached patch is fixing the issue for me.

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


More information about the wp-trac mailing list