[wp-trac] [WordPress Trac] #47419: If emojis or embeds JavaScript is not loaded, variable wp is undefined in the front-end.

WordPress Trac noreply at wordpress.org
Tue May 28 16:42:09 UTC 2019


#47419: If emojis or embeds JavaScript is not loaded, variable wp is undefined in
the front-end.
--------------------------+-----------------------------
 Reporter:  Shelob9       |      Owner:  (none)
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 In my plugin I am using wp.createElement in the front-end and using
 `wp_enqueue_scripts( 'wp-element' )` to load it. If emojis are disabled,
 the error "uncaught reference error, variable wp not defined" happens when
 trying to access wp.createElement.

 I could be wrong, but I think the problem is that if emojis are disabled,
 this line, which sets up the `wp` variable does not run.

 https://github.com/WordPress/WordPress/blob/master/wp-includes/js/wp-
 emoji.js#L290-L295

 Related bugs:
 * https://github.com/wp-media/wp-rocket/issues/1720
 * https://github.com/CalderaWP/Caldera-Forms/issues/3141
 * https://wordpress.org/support/topic/2-errors-in-console/

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


More information about the wp-trac mailing list