[wp-trac] [WordPress Trac] #23041: Images Don't Become Attached When Inserting a Gallery

WordPress Trac noreply at wordpress.org
Wed Dec 26 20:49:36 UTC 2012


#23041: Images Don't Become Attached When Inserting a Gallery
--------------------------+--------------------
 Reporter:  miqrogroove   |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.5.1
Component:  Gallery       |     Version:  3.5
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+--------------------
Changes (by trivum):

 * cc: trivum (added)


Comment:

 > Why do we need to make images in a gallery (WP3.5+) become attached to
 any post that appears to be using images pulled from other post ?
 [[BR]]


 I think it's important because, for one, it lets you insert galleries into
 template files and then update those galleries via the Media Manager.
 Suppose you had a gallery inserted in multiple spots in your template
 files. You would need to go back into each template and update the
 galleries by hand.

 The same goes for posts. You could make a gallery and then insert that
 gallery into multiple posts (let's say 10 different posts). If you wanted
 to update that gallery the way it is now, you would need to update each of
 the 10 different posts by hand. If the images were attached to the
 original gallery, you could just update that one gallery and the rest
 would be updated automatically. You could also update that gallery with
 the visual Media Manager (and not the less  user-friendly hand-edited
 shortcode).

 I came across this issue when trying to use a gallery id in a shortcode. I
 outlined it [http://wordpress.org/support/topic/gallery-id-shortcode-no-
 longer-working-in-35 here]:

 It seems that in 3.5 when you try to insert a gallery into a template file
 with the gallery id, it no longer works.

 Previously, for example, this would work:

 <?php echo do_shortcode('[gallery id="123"]'); ?>

 Now, however, because the shortcode has been changed to list out the
 individual images, referring to the gallery as a whole doesn't work
 anymore.

 The advantage of still having a reference to the entire gallery and not
 individual images in this case is that you can go in and edit the gallery
 in the visual editor without digging back into the template code. Just
 update the gallery as you like, and it's updated everywhere you inserted
 that gallery in your template files.

 Does anyone know if this is just a glitch, or is this how it will be going
 forward?

 According to [http://codex.wordpress.org/Gallery_Shortcode this page]
 (which seems to have been updated for 3.5 -- at least partly), referring
 to the entire gallery should still work.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23041#comment:11>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list