[wp-trac] [WordPress Trac] #27372: Add Media Button of wp_editor() is no more working on front-end since r27445

WordPress Trac noreply at wordpress.org
Wed Mar 12 10:20:24 UTC 2014


#27372: Add Media Button of wp_editor() is no more working on front-end since
r27445
--------------------------+--------------------
 Reporter:  imath         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.9
Component:  Media         |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+--------------------
Changes (by SergeyBiryukov):

 * milestone:  Awaiting Review => 3.9


Old description:

> Hi,
>
> First, i'd like to congratulate you for the great features introduced in
> the Media Editor in 3.9 next release.
>
> I've noticed #21811 makes it possible to edit image directly in the Media
> Editor, which is great :)
> Unfortunately, there seems to be an annoying side effect when the
> {{{wp_editor()}}} is used on front-end or if a plugin uses
> {{{wp_enqueue_media()}}} on front-end which is my case...
> Clicking on the "Add Media" button no more opens the Media Editor.
>
> I've seen @tomauger in his
> [https://core.trac.wordpress.org/ticket/21811#comment:64 comment]
> suggested a patch to fix it. It brings back the Media Editor but clicking
> on the "Edit image" link of the Media details side box loads the Image
> Edit view without the toolbar. So it's not usable. The problem seems to
> be that this part needs a css file that is included in the {{{wp-admin}}}
> one.
> I guess it's one good reason to have the is_admin() check before
> enqueueing {{{image-edit}}}.
>
> On my local dev, i've built an alternative patch which seems to solve the
> side effect. So i thought you might be interested by it. I hope i didn't
> do wrong by creating a new ticket instead of carrying on the discussion
> in the original ticket. If i did, i apologize.

New description:

 Hi,

 First, i'd like to congratulate you for the great features introduced in
 the Media Editor in 3.9 next release.

 I've noticed #21811 makes it possible to edit image directly in the Media
 Editor, which is great :)
 Unfortunately, there seems to be an annoying side effect when the
 {{{wp_editor()}}} is used on front-end or if a plugin uses
 {{{wp_enqueue_media()}}} on front-end which is my case...
 Clicking on the "Add Media" button no more opens the Media Editor since
 [27445].

 I've seen @tomauger in his
 [https://core.trac.wordpress.org/ticket/21811#comment:64 comment]
 suggested a patch to fix it. It brings back the Media Editor but clicking
 on the "Edit image" link of the Media details side box loads the Image
 Edit view without the toolbar. So it's not usable. The problem seems to be
 that this part needs a css file that is included in the {{{wp-admin}}}
 one.
 I guess it's one good reason to have the is_admin() check before
 enqueueing {{{image-edit}}}.

 On my local dev, i've built an alternative patch which seems to solve the
 side effect. So i thought you might be interested by it. I hope i didn't
 do wrong by creating a new ticket instead of carrying on the discussion in
 the original ticket. If i did, i apologize.

--

--
Ticket URL: <https://core.trac.wordpress.org/ticket/27372#comment:2>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list