[wp-trac] [WordPress Trac] #32999: Provide a way to not attached unattached image when inserting into post.

WordPress Trac noreply at wordpress.org
Wed Jul 15 10:18:29 UTC 2015


#32999: Provide a way to not attached unattached image when inserting into post.
-------------------------+-----------------------------
 Reporter:  husobj       |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Media        |    Version:  4.2.2
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 Back around WordPress 3.5 the functionality was introduced to attach
 unattached images to a post when they are inserted into editor #22085

 wp_ajax_send_attachment_to_editor()
 https://core.trac.wordpress.org/browser/trunk/src/wp-admin/includes/ajax-
 actions.php#L2465

 This may not always be desired behaviour.

 I have used (and created) themes that automatically display galleries
 based on images attached to a post. If I then want to insert another image
 from the media library into the post editor such as a logo, this image
 then becomes attached and automatically becomes part of the auto-generated
 gallery.

 Similarly there are cases where you may automatically want to select an
 attached image to use as a featured image if no featured image is set. For
 example eCommerce products where removing the requirement to set a
 featured image is implemented. In this case you would also want to insert
 other images into the editor without them attaching.

 In the case of an image like a logo, this is a generic image in my media
 library that may get used by many posts and I would not necessarily want
 it to become associated with a specific post. Automatically creating that
 relationship may be confusing.

 So my question is would it be possible to introduce a filter so that this
 default behaviour can be prevented?

 It would also relate to #23041 (attaching unattached images when inserting
 gallery) as you would want the filter to prevent this too.

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


More information about the wp-trac mailing list