[wp-trac] [WordPress Trac] #28641: wp_enqueue_media() breaks media library

WordPress Trac noreply at wordpress.org
Thu Jun 26 07:32:08 UTC 2014


#28641: wp_enqueue_media() breaks media library
--------------------------------+-----------------------------
 Reporter:  McGuive7            |      Owner:
     Type:  defect (bug)        |     Status:  new
 Priority:  normal              |  Milestone:  Awaiting Review
Component:  Media               |    Version:  trunk
 Severity:  normal              |   Keywords:
  Focuses:  ui, administration  |
--------------------------------+-----------------------------
 I've encountered an issue with {{{wp_enqueue_media()}}} and the media
 library that seems similar to some previous tickets, but unique enough
 that it may warrant it's own ticket. Furthermore this issue appears only
 in WP 4.0 alpha for me, so it may be a recently introduced bug.

 The issue: Adding a call to {{{wp_enqueue_media()}}} in my plugin/theme
 causes the media library list view to break. Specifically, this appears to
 cause both the grid/gallery and list views to display simultaneously, with
 the grid/gallery view overlaid on top of the list view, rendering the list
 view unclickable. See below image:
 [[Image(http://i.imgur.com/Fmyc9Su.png)]]

 The code:
 {{{
 add_action( 'admin_enqueue_scripts', 'custom_admin_scripts' );
 function custom_admin_scripts() {
         wp_enqueue_media();
 }
 }}}

 I've created a demo plugin that includes a basic {{{wp_enqueue_media()}}}
 call hooked to {{{admin_enqueue_scripts}}} (the recommended hook as per
 [http://codex.wordpress.org/Function_Reference/wp_enqueue_media]) - see
 attached. Interestingly, it appears that things work just fine if I hook
 the call to the admin_footer hook, however if I attach it to any earlier
 hook, the issue occurs again.


 I've tested this issue with only the demo plugin installed, and the
 default Twenty Fourteen theme activated, so it seems to be directly
 related to the {{{wp_enqueue_media()}}} call as opposed to any combined
 set of plugin/theme conflicts.

 Happy to provide more data if need be, just let me know.

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


More information about the wp-trac mailing list